index.vue 94 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162
  1. <!--
  2. * @Descripttion:
  3. * @version:
  4. * @Author: Eugene
  5. * @Date: 2023-10-17 14:40:41
  6. * @LastEditors: Andy
  7. * @LastEditTime: 2023-11-10 11:24:22
  8. -->
  9. <template>
  10. <div id="menuConfigs" data-num="deveModels" class="dev-config">
  11. <el-row :gutter="0" class="projectDisplay">
  12. <el-col :span="14" style="padding: 5px 0px">
  13. <label>{{ $t("module.3039063d-477d-45a1-a403-f87aa04373b5") }}</label>
  14. <yu-select
  15. v-model="versionValue"
  16. value-key="id"
  17. :clearable="false"
  18. :placeholder="$t('module.8aabd0da-b98c-4588-8ed8-f84370134560')"
  19. style="width: 180px"
  20. class="version-select-width"
  21. size="small"
  22. @change="queryTreeByVersion"
  23. >
  24. <yu-option-group
  25. v-for="group in versionData"
  26. :key="group.label"
  27. :label="group.label"
  28. >
  29. <yu-option
  30. v-for="item in group.options"
  31. :key="item.id"
  32. :label="item.versionCode + ' ' + '( ' + item.dbType + ' )'"
  33. :value="item"
  34. >
  35. <!-- <yu-tooltip class="item" effect="dark" :content="item.jobName?item.jobName:''" placement="bottom"> -->
  36. <!-- <span
  37. class="label-model">{{ item.versionCode + ' ' + '( ' + item.dbType + ' )' + ' ' + (item.jobName?item.jobName:'')}}</span> -->
  38. <!-- </yu-tooltip> -->
  39. <span>
  40. <i
  41. :class="[
  42. 'iconfont_dms',
  43. taskStatus[item.jobStatus]
  44. ? taskStatus[item.jobStatus].color
  45. : '',
  46. ]"
  47. :title="
  48. taskStatus[item.jobStatus]
  49. ? taskStatus[item.jobStatus].desc
  50. : ''
  51. "
  52. style="font-weight: normal; font-size: 14px"
  53. ></i>
  54. <span style="font-size: 13px">{{
  55. item.versionCode + " " + "(" + item.dbType + ")"
  56. }}</span>
  57. </span>
  58. <span style="float: right; font-size: 13px; padding-top: 1px">
  59. <span style="color: #8492a6">{{
  60. item.jobName ? item.jobName : ""
  61. }}</span>
  62. </span>
  63. </yu-option>
  64. </yu-option-group>
  65. </yu-select>
  66. <yu-radio v-model="scope" label="all" style="margin-left: 20px">{{
  67. $t("module.d76fc1ec-6d8b-417b-b52e-b9f2382d741a")
  68. }}</yu-radio>
  69. <yu-radio v-model="scope" label="my">{{
  70. $t("module.f6e7c367-5d87-48f7-ad01-8fbb2cb748cf")
  71. }}</yu-radio>
  72. </el-col>
  73. <el-col :span="10" class="leftButton">
  74. <div class="buttonSty">
  75. <div
  76. @click="publishScript"
  77. class="fbjb"
  78. style="vertical-align: bottom"
  79. >
  80. <yu-tooltip
  81. class="item"
  82. effect="dark"
  83. :content="$t('module.fbbc2314-f58a-4d48-8bcd-df229b10c4f2')"
  84. placement="bottom"
  85. >
  86. <span class="el-icon-yx-images-fbjb"></span>
  87. </yu-tooltip>
  88. </div>
  89. <div
  90. @click="getModelFromMaster"
  91. class="lqmx"
  92. style="vertical-align: bottom"
  93. v-if="
  94. ['20', '41'].includes(versionValue.jobStatus) &&
  95. versionValue.versionCode !== 'master'
  96. "
  97. >
  98. <yu-tooltip
  99. class="item"
  100. effect="dark"
  101. :content="$t('module.458bdc40-996d-4778-8c5d-7e99afca5ce7')"
  102. placement="bottom"
  103. >
  104. <span class="el-icon-yx-images-lqmx"></span>
  105. </yu-tooltip>
  106. </div>
  107. <div
  108. @click="getModelFromMaster"
  109. class="lqmx"
  110. style="vertical-align: bottom"
  111. v-if="versionValue.versionCode === 'LOGIC'"
  112. >
  113. <yu-tooltip
  114. class="item"
  115. effect="dark"
  116. :content="$t('module.e5d826ce-56c0-4451-9a6d-b1503121f1b8')"
  117. placement="bottom"
  118. >
  119. <span class="el-icon-yx-images-lqmx"></span>
  120. </yu-tooltip>
  121. </div>
  122. <div
  123. @click="getModelFromLogic"
  124. class="lqmx"
  125. style="vertical-align: bottom"
  126. v-if="
  127. ['20', '41'].includes(versionValue.jobStatus) &&
  128. versionValue.versionCode !== 'master'
  129. "
  130. >
  131. <yu-tooltip
  132. class="item"
  133. effect="dark"
  134. :content="$t('module.60ffe87e-ffca-4c4c-ae70-58ddc2e15b3d')"
  135. placement="bottom"
  136. >
  137. <span class="el-icon-yx-images-lqmx"></span>
  138. </yu-tooltip>
  139. </div>
  140. <div @click="toModelTable">
  141. <yu-tooltip
  142. class="item"
  143. effect="dark"
  144. :content="$t('module.9fc6cf3f-7d48-4735-8a53-7bf1fe52a997')"
  145. placement="bottom"
  146. >
  147. <span class="iconfont_dms iconliebiao1"></span>
  148. </yu-tooltip>
  149. </div>
  150. <div
  151. @click="addModelFn"
  152. style="border-left: 1px dashed #979494; padding-left: 14px"
  153. v-if="
  154. ['20', '41'].includes(versionValue.jobStatus) ||
  155. ['LOGIC'].includes(versionValue.versionCode)
  156. "
  157. >
  158. <yu-tooltip
  159. class="item"
  160. effect="dark"
  161. :content="$t('module.4a0763bf-2e20-4823-9fae-cca932adc173')"
  162. placement="bottom"
  163. >
  164. <span class="iconfont_dms iconxinjianmoxing"></span>
  165. </yu-tooltip>
  166. </div>
  167. <div>
  168. <yu-dropdown @command="handleCommand">
  169. <span class="el-dropdown-link">
  170. <!-- <span class="iconfont_dms icondaochu"></span> -->
  171. <span
  172. class="el-icon-download"
  173. style="font-weight: bold; font-size: 16px"
  174. ></span>
  175. </span>
  176. <yu-dropdown-menu slot="dropdown">
  177. <yu-dropdown-item command="png">{{
  178. $t("module.e2883676-2304-443c-a699-f01b79f7fa13")
  179. }}</yu-dropdown-item>
  180. <!-- <yu-dropdown-item command="word">{{ $t('module.85a47a85-fb4c-431a-8973-0e59cafe4ca2') }}</yu-dropdown-item> -->
  181. </yu-dropdown-menu>
  182. </yu-dropdown>
  183. </div>
  184. <div
  185. @click="downModelFn"
  186. v-if="
  187. ['20', '41'].includes(versionValue.jobStatus) ||
  188. ['LOGIC'].includes(versionValue.versionCode)
  189. "
  190. >
  191. <yu-tooltip
  192. class="item"
  193. effect="dark"
  194. :content="$t('module.ca822d70-3328-4f36-bb37-ec3f1dcc04ad')"
  195. placement="bottom"
  196. >
  197. <!-- <span class="iconfont_dms icondaoru"></span> -->
  198. <span class="el-icon-upload2" style="font-size: 14px"></span>
  199. </yu-tooltip>
  200. </div>
  201. <div @click="refreshCanvas">
  202. <yu-tooltip
  203. class="item"
  204. effect="dark"
  205. :content="
  206. $t('module.96a0aabd-397a-49ab-8dcd-a6558ea58017') + '(Shift+R)'
  207. "
  208. placement="bottom"
  209. >
  210. <span class="iconfont_dms iconmd-refresh"></span>
  211. </yu-tooltip>
  212. </div>
  213. <div
  214. @click="largeOrSmall('enlarge')"
  215. @mouseover="mouseOver('enlarge')"
  216. >
  217. <yu-tooltip
  218. class="item"
  219. effect="dark"
  220. :content="enlarge"
  221. placement="bottom"
  222. >
  223. <span class="iconfont_dms iconfangda"></span>
  224. </yu-tooltip>
  225. </div>
  226. <div @click="largeOrSmall('narrow')" @mouseover="mouseOver('narrow')">
  227. <yu-tooltip
  228. class="item"
  229. effect="dark"
  230. :content="narrow"
  231. placement="bottom"
  232. >
  233. <span class="iconfont_dms iconmd-miner"></span>
  234. </yu-tooltip>
  235. </div>
  236. <div @click="modelShow('s')" v-if="modelShowFlag == 'f'">
  237. <yu-tooltip
  238. class="item"
  239. effect="dark"
  240. :content="$t('module.cf03b34c-f71a-452b-a639-d6b3a936de64')"
  241. placement="bottom"
  242. >
  243. <span class="iconfont_dms iconsuolvtu"></span>
  244. </yu-tooltip>
  245. </div>
  246. <div @click="modelShow('f')" v-if="modelShowFlag == 's'">
  247. <yu-tooltip
  248. class="item"
  249. effect="dark"
  250. :content="$t('module.280a25c0-3d9b-435a-bb81-773f87d69efe')"
  251. placement="bottom"
  252. >
  253. <span class="iconfont_dms iconzhengchang"></span>
  254. </yu-tooltip>
  255. </div>
  256. <div @click="showCnoren()">
  257. <yu-tooltip
  258. class="item"
  259. effect="dark"
  260. :content="$t('module.f37b4b82-1a12-45e8-b3f6-33ea7206ff51')"
  261. placement="bottom"
  262. >
  263. <span class="iconfont_dms iconfanyi"></span>
  264. </yu-tooltip>
  265. </div>
  266. <div
  267. @click="autoLayout"
  268. v-if="
  269. ['20', '41'].includes(versionValue.jobStatus) ||
  270. ['master', 'LOGIC'].includes(versionValue.versionCode)
  271. "
  272. >
  273. <yu-tooltip
  274. class="item"
  275. effect="dark"
  276. :content="$t('module.758bb095-602d-4bdc-94ce-520ec4d860c8')"
  277. placement="bottom"
  278. >
  279. <span class="iconfont_dms iconlayout"></span>
  280. </yu-tooltip>
  281. </div>
  282. </div>
  283. </el-col>
  284. </el-row>
  285. <div class="dms-bodys">
  286. <div class="home_is_visible">
  287. <!-- 树 -->
  288. <div class="dms-menu treeStyle" id="dms-menu-tree">
  289. <div class="search-model">
  290. <yu-input
  291. size="small"
  292. :placeholder="$t('module.3a1f4707-c2e7-48a3-bc96-39d2943b37ae')"
  293. @keyup.enter.native="queryModelList"
  294. v-model="filterText"
  295. icon="search"
  296. :on-icon-click="queryModelList"
  297. >
  298. </yu-input>
  299. </div>
  300. <div class="account-model">
  301. <yu-checkbox v-model="checkBlue" @change="valueChange">{{
  302. $t("module.598d4494-0014-4146-b29f-d276cc811583")
  303. }}</yu-checkbox>
  304. <span
  305. class="iconfont_dms iconmd-del count_label"
  306. @click="batchDeleteModels"
  307. :title="$t('module.58a11724-6ebc-40ba-a424-9e90359a0d92')"
  308. v-if="
  309. ['20', '41'].includes(versionValue.jobStatus) ||
  310. ['LOGIC'].includes(versionValue.versionCode)
  311. "
  312. style="border-left: 1px dashed #d8d8d8; padding-left: 4px"
  313. >
  314. </span>
  315. <span
  316. class="iconfont_dms iconfabu count_label"
  317. @click="submitOne"
  318. :title="$t('module.2a3e2482-05f8-462e-ac9c-0aa99038296a')"
  319. v-if="
  320. ['20', '41'].includes(versionValue.jobStatus) ||
  321. ['master', 'LOGIC'].includes(versionValue.versionCode)
  322. "
  323. >
  324. </span>
  325. <span
  326. class="iconfont_dms iconyijiao count_label"
  327. @click="changeFun"
  328. :title="$t('module.8dc945e5-4e9b-4aac-a80b-3ef29bb595f1')"
  329. v-if="
  330. ['20', '41'].includes(versionValue.jobStatus) ||
  331. ['master', 'LOGIC'].includes(versionValue.versionCode)
  332. "
  333. ></span>
  334. <span
  335. class="iconfont_dms iconmd-version count_label"
  336. @click="copyFun"
  337. :title="$t('module.1505c125-b519-470a-9e70-7f71fe832917')"
  338. v-if="
  339. ['20', '41'].includes(versionValue.jobStatus) ||
  340. ['master', 'LOGIC'].includes(versionValue.versionCode)
  341. "
  342. ></span>
  343. <span
  344. class="iconfont_dms iconmd-refresh count_label"
  345. @click="queryModelList"
  346. :title="$t('module.96a0aabd-397a-49ab-8dcd-a6558ea58017')"
  347. ></span>
  348. <span class="count_labels">{{
  349. checkedCount + "/" + sumCount
  350. }}</span>
  351. </div>
  352. <yu-xtree
  353. ref="menuTree"
  354. class="dms-tree project-tree pro_model_tree"
  355. show-checkbox
  356. :accordion="true"
  357. :local-data="treeData"
  358. :height="height - 150"
  359. :data-root="dataRoot"
  360. data-id="id"
  361. data-label="label"
  362. @node-click="nodeClickFn"
  363. @node-expand="nodeClickFn"
  364. data-pid="parentId"
  365. node-key="id"
  366. :highlight-current="true"
  367. :default-expanded-keys="defaultArr"
  368. :render-content="renderContent"
  369. @check-change="nodeCheck"
  370. >
  371. </yu-xtree>
  372. </div>
  373. <!-- 按钮 -->
  374. <div class="dms-button" @click="clickBut">
  375. <div class="outer-box">
  376. <div class="inner-box">
  377. <div class="trangle trangle-right"></div>
  378. </div>
  379. </div>
  380. </div>
  381. <!-- 右侧画布 -->
  382. <div class="dms-content home">
  383. <div id="modelTTree" style="background-color: #fff">
  384. <md-canvas
  385. :module-id="moduleId"
  386. ref="mdCanvas"
  387. @edit-model="preEditModel"
  388. @refresh-tree="queryModelList"
  389. :version="versionValue.versionCode"
  390. :project-id="projectId"
  391. :db-type="projectDbType"
  392. :scope="scope"
  393. @enter-module="backRefeshTree"
  394. :coll-expand="collExpand"
  395. :project-role="versionValue.jobStatus"
  396. :task-id="versionValue.jobId"
  397. :node-level="nodeLevel"
  398. />
  399. </div>
  400. </div>
  401. </div>
  402. </div>
  403. <!--标准树抽屉 规范检查抽屉 控制按钮 v-if="projectValue.projectRole !== 'Guest'"-->
  404. <div class="minWindowR">
  405. <div
  406. @click="!isViewModel && addStdFn()"
  407. style="margin-bottom: 6px; cursor: pointer"
  408. :class="[
  409. 'right_icon',
  410. stdDrawer ? 'active' : '',
  411. isViewModel ? 'div_disabled' : '',
  412. ]"
  413. >
  414. <div
  415. class="iconfont iconfont_dms iconshujubiaozhun_2 icon_active"
  416. ></div>
  417. <div class="word_row">
  418. {{ $t("module.7bf2e647-88dd-4de9-bcb3-34d85e783ee8") }}
  419. </div>
  420. </div>
  421. <div
  422. @click="!isViewModel && addCheckFn()"
  423. style="cursor: pointer"
  424. :class="[
  425. 'right_icon',
  426. drawer ? 'active' : '',
  427. isViewModel ? 'div_disabled' : '',
  428. ]"
  429. >
  430. <div class="iconfont iconfont_dms iconguifanjiancha icon_active"></div>
  431. <div class="word_row">
  432. {{ $t("module.e2d53c60-4e4e-4548-ab64-1bc03dda61ab") }}
  433. </div>
  434. </div>
  435. </div>
  436. <!--一致性检查-->
  437. <consistencyCheck
  438. v-if="checkVisible"
  439. :visible.sync="checkVisible"
  440. @close-dia="checkVisible = false"
  441. :version-code="versionValue.versionCode"
  442. :module-id="moduleId"
  443. @back-deal="backDeal"
  444. >
  445. </consistencyCheck>
  446. <!--下方 规范检查 抽屉-->
  447. <el-drawer
  448. :append-to-body="false"
  449. size="100%"
  450. :modal="false"
  451. :title="$t('module.2f03ee2c-09ee-4a6d-8841-1e1aa5edf381')"
  452. :visible.sync="drawer"
  453. direction="btt"
  454. class="drawer_tabs rules_check"
  455. style="height: 46%; top: unset; left: 255px"
  456. >
  457. <yu-tabs
  458. v-model="activeRealDeatil"
  459. class="real-detail-tab"
  460. @tab-click="handleClick"
  461. ref="tabs"
  462. >
  463. <yu-tab-pane
  464. v-for="(item, index) in rulesType"
  465. :key="index"
  466. :name="item.key"
  467. >
  468. <span slot="label"
  469. ><i :class="['iconfont iconfont_dms', typeClass[item.key]]"></i>
  470. {{ item.value }}</span
  471. >
  472. <yu-xtable
  473. :data="tableData"
  474. ref="refTable"
  475. row-number
  476. height="calc(46vh - 140px)"
  477. :pageable="false"
  478. v-if="tableData.length"
  479. >
  480. <yu-xtable-column
  481. prop="message"
  482. :label="$t('module.2f03ee2c-09ee-4a6d-8841-1e1aa5edf386')"
  483. show-overflow-tooltip
  484. >
  485. </yu-xtable-column>
  486. <yu-xtable-column
  487. prop="path"
  488. :label="$t('module.7112cb6f-08f2-4a4c-8712-b1f57feea0d3')"
  489. show-overflow-tooltip
  490. >
  491. <template slot-scope="scope">
  492. <yu-button
  493. type="text"
  494. v-if="scope.row.path"
  495. @click="checkModel(scope.row)"
  496. >
  497. {{ scope.row.path }}
  498. </yu-button>
  499. </template>
  500. </yu-xtable-column>
  501. </yu-xtable>
  502. <!-- 空白提示 -->
  503. <div
  504. v-if="!tableData.length"
  505. class="null-data"
  506. style="height: calc(46vh - 200px)"
  507. >
  508. <div class="image null_png"></div>
  509. <div>{{ $t("module.a0433e6a-8f8b-4bcb-be15-6d58b8516976") }}</div>
  510. </div>
  511. </yu-tab-pane>
  512. </yu-tabs>
  513. <div
  514. style="
  515. position: absolute;
  516. top: 70px;
  517. right: 20px;
  518. color: #676b6f;
  519. cursor: pointer;
  520. "
  521. >
  522. <span @click="startCheck" class="bag_span">
  523. <i class="iconfont iconfont_dms iconkaishijiancha blue_span"></i>
  524. <span style="padding-left: 2px">{{
  525. $t("module.e54a8392-a8c1-4324-ba31-fc42085b0e7e")
  526. }}</span>
  527. </span>
  528. <span
  529. @click="checkRules"
  530. class="bag_span"
  531. style="margin-left: 8px; cursor: pointer"
  532. >
  533. <i class="iconfont iconfont_dms iconjianchaxuanxiang blue_span"></i>
  534. <span style="padding-left: 2px">{{
  535. $t("module.e08d9b6a-52ed-4100-9d39-db0f72580b79")
  536. }}</span>
  537. </span>
  538. </div>
  539. </el-drawer>
  540. <!--数据标准 -->
  541. <el-drawer
  542. :append-to-body="false"
  543. size="100%"
  544. :modal="false"
  545. :title="$t('module.7bf2e647-88dd-4de9-bcb3-34d85e783ee8')"
  546. :visible.sync="stdDrawer"
  547. direction="rtl"
  548. class="drawer_tabs"
  549. style="top: 144px; right: 48px; width: 260px; bottom: 15px; left: unset"
  550. >
  551. <div class="right_view">
  552. <div :class="['header', { leftChange: $labelPosition == 'top' }]">
  553. <span
  554. @click="checkUniformity"
  555. style="cursor: pointer; color: #255ddb"
  556. >{{ $t("module.6dbc9a80-2b63-4931-8486-be39d740b1ac") }}</span
  557. >
  558. </div>
  559. <yu-tabs v-model="statusTypeDb" @tab-click="customSearchFn">
  560. <yu-tab-pane
  561. v-for="(item, index) in sendStateOptions"
  562. :key="index"
  563. :label="item.value"
  564. :name="item.key"
  565. >
  566. <yu-input
  567. size="small"
  568. :placeholder="$t('module.3c1fd4d7-0870-414b-b29e-20f2de8bbdf0')"
  569. v-model="filterStd"
  570. icon="search"
  571. >
  572. </yu-input>
  573. <yu-xtree
  574. ref="stdRef"
  575. :local-data="stdata"
  576. data-id="id"
  577. data-label="name"
  578. data-pid="parentId"
  579. v-loading="treeLoading"
  580. data-root="0"
  581. @node-dbclick="nodeDbClick"
  582. :filter-node-method="filterNode"
  583. style="color: #333; height: calc(100vh - 356px)"
  584. :render-content="renderContentStd"
  585. >
  586. </yu-xtree>
  587. <stdsDeatil
  588. v-if="stdTailVisible"
  589. :visible.sync="stdTailVisible"
  590. :open-time="openTime"
  591. :menu-id="stdMenuId"
  592. :model-id="modelId"
  593. @close-dia="stdTailVisible = false"
  594. :status-type="statusTypeDb"
  595. />
  596. </yu-tab-pane>
  597. </yu-tabs>
  598. </div>
  599. </el-drawer>
  600. <yu-xdialog
  601. :title="$t('module.f3b26f32-bdac-4bb6-a5d9-422128d35976')"
  602. :visible.sync="uploadDialog"
  603. width="400px"
  604. >
  605. <yu-xform
  606. :label-position="$labelPosition"
  607. label-width="100px"
  608. v-model="fileTypeForm"
  609. ref="fileTypeFormRef"
  610. >
  611. <yu-xform-group :column="1">
  612. <yu-xform-item
  613. :label="$t('module.d1e59627-885a-4911-a8b0-fba1328875ab')"
  614. name="fileType"
  615. :options="options"
  616. ctype="radio"
  617. ></yu-xform-item>
  618. </yu-xform-group>
  619. <div class="yu-grpButton">
  620. <yu-button type="primary" @click="uploadFn">{{
  621. $t("module.e1f5797b-071e-41a2-9ca4-421b32458c6e")
  622. }}</yu-button>
  623. </div>
  624. </yu-xform>
  625. </yu-xdialog>
  626. <yu-xdialog
  627. :title="$t('module.93ec2b54-7b64-4344-8b56-5de4023281f7')"
  628. :visible.sync="dialogImport"
  629. width="800px"
  630. size="large"
  631. >
  632. <import-model
  633. @callback-fun="callBackFun"
  634. :open-time="openTimes"
  635. :other-data="otherData"
  636. />
  637. </yu-xdialog>
  638. <yu-xdialog
  639. :title="$t('module.7f27e95d-c43f-4cd5-af04-998c16902bff')"
  640. :visible.sync="editModelDialog"
  641. width="1200px"
  642. height="620px"
  643. :before-close="closeDialog"
  644. class="modelDialog"
  645. >
  646. <model-edit
  647. v-if="editModelDialog"
  648. ref="modelEdit"
  649. :model-id="modelId"
  650. :project-id="projectId"
  651. :project-name="projectName"
  652. @close-dialog="cancelEditFn"
  653. @refresh-tree="queryModelList"
  654. :open-time="openTime"
  655. :db-type="projectDbType"
  656. version-flag="dashboard"
  657. :dialog-height="diaHeight"
  658. :model-dialog="editModelDialog"
  659. :disabled="modelDisabled"
  660. :version="versionValue.versionCode"
  661. :version-id="versionValue.id"
  662. :if-std="ifStd"
  663. :project-role="versionValue.jobStatus"
  664. :active-tab="activeTab"
  665. >
  666. </model-edit>
  667. </yu-xdialog>
  668. <yu-xdialog
  669. :title="$t('module.b7a38aa1-47b8-4fec-b5e9-161096fc781e')"
  670. :visible.sync="modelSubDialog"
  671. width="600px"
  672. max-height="300px"
  673. >
  674. <submit-models
  675. :real-id="realIds"
  676. @back-deal="backDeal"
  677. :open-time="openTimeSub"
  678. @close-dialog="closeFn"
  679. :task-id="versionValue.jobId"
  680. />
  681. </yu-xdialog>
  682. <yu-xdialog
  683. :title="$t('module.f4df97a2-2a43-49fc-a4e3-17b865f5807e')"
  684. :visible.sync="modelExportDialog"
  685. width="600px"
  686. height="300px"
  687. >
  688. <yu-xtree
  689. ref="modelExportTree"
  690. class="dms-tree project-trees"
  691. :local-data="treeData"
  692. :data-root="dataRoot"
  693. data-id="id"
  694. data-label="name"
  695. :show-checkbox="true"
  696. data-pid="parentId"
  697. node-key="id"
  698. :highlight-current="true"
  699. default-expand-all
  700. :default-checked-keys="defaultExportArr"
  701. >
  702. </yu-xtree>
  703. <div class="yu-grpButton" style="text-align: right">
  704. <yu-button type="primary" @click="exportFn">{{
  705. $t("module.4809f56c-b004-4991-8cf9-b58fb4b9fb3b")
  706. }}</yu-button>
  707. </div>
  708. </yu-xdialog>
  709. <yu-xdialog
  710. :title="$t('module.69bd1f71-e6bd-43a2-b95c-3c8117fa8e64')"
  711. :visible.sync="addProjectVisible"
  712. width="640px"
  713. >
  714. <creat-project @back-do="backDo" @close-create="closeCrePro" />
  715. </yu-xdialog>
  716. <yu-xdialog :title="title" :visible.sync="modelDialog" width="550px">
  717. <yu-xform
  718. label-width="120px"
  719. :label-position="$labelPosition"
  720. label-suffix=":"
  721. v-model="modelformdata"
  722. style="margin-top: 20px"
  723. ref="modelformRef"
  724. >
  725. <yu-xform-group :column="1">
  726. <yu-xform-item
  727. :label="$t('module.c62781fd-b510-47b5-b89d-8ea391e7be40')"
  728. ctype="custom"
  729. name="custom"
  730. :readonly="true"
  731. >
  732. <yu-combo-tree
  733. v-model="selected"
  734. :multiple="false"
  735. :local-data="moduleNameOps"
  736. data-id="id"
  737. all-node-value
  738. data-label="modelName"
  739. data-pid="pmodelid"
  740. data-root="null"
  741. clearable
  742. >
  743. </yu-combo-tree>
  744. </yu-xform-item>
  745. <yu-xform-item
  746. :label="$t('module.51a40c1e-e2ff-4d19-9a01-a4f2745ca7d0')"
  747. ctype="input"
  748. name="modelName"
  749. maxlength="32"
  750. :rules="modelNameRule"
  751. >
  752. </yu-xform-item>
  753. <yu-xform-item
  754. :label="$t('module.433416cd-2a22-462b-a5bd-9c948d236c91')"
  755. ctype="input"
  756. name="modelCode"
  757. maxlength="32"
  758. :rules="modelCodeRule"
  759. >
  760. </yu-xform-item>
  761. <yu-xform-item
  762. :label="$t('module.1cb01ef2-ace7-4a3d-8246-955c05df442b')"
  763. ctype="num"
  764. name="modelOrder"
  765. :rules="modelOrderRule"
  766. ></yu-xform-item>
  767. <yu-xform-item
  768. :label="$t('module.92f5885f-9768-4a9d-9238-635a0fd53b2b')"
  769. ctype="input"
  770. name="schemaName"
  771. :rules="schemaRule"
  772. >
  773. </yu-xform-item>
  774. <yu-xform-item
  775. :label="$t('module.5e14769b-d1aa-44fe-a4c8-48fe51780853')"
  776. ctype="textarea"
  777. :row="2"
  778. colspan="24"
  779. maxlength="255"
  780. name="modelDesc"
  781. >
  782. </yu-xform-item>
  783. </yu-xform-group>
  784. </yu-xform>
  785. <div class="button-group" style="text-align: right">
  786. <el-button @click="modelDialog = false">{{
  787. $t("module.de26e309-74a6-48ce-8fa4-c37cb63cf622")
  788. }}</el-button>
  789. <el-button type="primary" @click="saveTreeFn">{{
  790. $t("module.e1f5797b-071e-41a2-9ca4-421b32458c6e")
  791. }}</el-button>
  792. </div>
  793. </yu-xdialog>
  794. <yu-xdialog
  795. :title="$t('module.2c689ef7-fb20-4a30-9359-545dee747067')"
  796. :visible.sync="autoLayoutCfgFlag"
  797. width="550px"
  798. >
  799. <yu-xform
  800. label-width="120px"
  801. label-suffix=":"
  802. v-model="autoLayoutCfg"
  803. style="margin-top: 20px"
  804. ref="modelformRef"
  805. >
  806. <yu-xform-group :column="1">
  807. <yu-xform-item
  808. :label="$t('module.eaad8a1a-62c4-4d49-add0-215474e1153e')"
  809. ctype="input"
  810. type="num"
  811. name="n"
  812. >
  813. </yu-xform-item>
  814. <yu-xform-item
  815. :label="$t('module.540ddea1-8942-46e7-bc80-a65c1679d563')"
  816. ctype="input"
  817. type="num"
  818. name="rowHeight"
  819. >
  820. </yu-xform-item>
  821. </yu-xform-group>
  822. </yu-xform>
  823. <div class="button-group" style="text-align: right">
  824. <el-button @click="autoLayoutCfgFlag = false">{{
  825. $t("module.de26e309-74a6-48ce-8fa4-c37cb63cf622")
  826. }}</el-button>
  827. <el-button type="primary" @click="doLayout">{{
  828. $t("module.e1f5797b-071e-41a2-9ca4-421b32458c6e")
  829. }}</el-button>
  830. </div>
  831. </yu-xdialog>
  832. <yu-xdialog
  833. :title="$t('module.6990c6b2-3726-4a9a-af63-6322aaa59399')"
  834. class="normal-dialog"
  835. :visible.sync="changeModuleDialog"
  836. width="600px"
  837. style="min-height: 200px"
  838. >
  839. <module-tree
  840. v-if="changeModuleDialog"
  841. flag="move"
  842. @refersh-fn="closeChangeModule"
  843. :model-ids="modelIds"
  844. />
  845. </yu-xdialog>
  846. <yu-xdialog
  847. :title="$t('module.0c0308c8-33b1-4038-bd13-ccd375e25f10')"
  848. class="normal-dialog"
  849. :visible.sync="deleteModuleDialog"
  850. width="600px"
  851. max-height="300px"
  852. >
  853. <delete-model
  854. :ids="ids"
  855. :open-time="openTime"
  856. @ref-query="refQuery"
  857. :task-id="versionValue.jobId"
  858. />
  859. </yu-xdialog>
  860. <yu-xdialog
  861. :title="$t('module.1505c125-b519-470a-9e70-7f71fe832917')"
  862. :visible.sync="copyModelFlag"
  863. width="600px"
  864. >
  865. <module-tree
  866. v-if="copyModelFlag"
  867. flag="copy"
  868. @refersh-fn="backFormCopy"
  869. :model-ids="modelIds"
  870. ></module-tree>
  871. </yu-xdialog>
  872. <yu-xdialog
  873. :title="$t('module.01965805-22ad-4cc0-9c44-ccee0adcf2c3')"
  874. :visible.sync="getModelVisible"
  875. width="600px"
  876. height="460px"
  877. >
  878. <module-tree-simple
  879. ref="getModelRef"
  880. @refersh-fn="getModelBack"
  881. :project-id="projectId"
  882. :version="versionValue.versionCode"
  883. >
  884. </module-tree-simple>
  885. <div slot="footer" class="dialog-footer" style="text-align: right">
  886. <yu-button type="primary" @click="getModel">{{
  887. $t("module.e1f5797b-071e-41a2-9ca4-421b32458c6e")
  888. }}</yu-button>
  889. </div>
  890. </yu-xdialog>
  891. <!-- 模型拉取 - LOGIC -->
  892. <dialog-logic-version
  893. ref="logicDialogRef"
  894. :project-id="projectId"
  895. :version-data="versionValue"
  896. @refersh-fn="getModelBack"
  897. >
  898. </dialog-logic-version>
  899. <!--发布脚本-->
  900. <pub-script
  901. :project-id="projectId"
  902. :version="versionValue.versionCode"
  903. v-if="pubScriptlVisible"
  904. ref="pubScriptRef"
  905. @refersh-fn="closeBack"
  906. ></pub-script>
  907. <yu-xdialog
  908. :title="$t('module.e08d9b6a-52ed-4100-9d39-db0f72580b79')"
  909. :visible.sync="setRuleVisible"
  910. width="600px"
  911. >
  912. <div class="rules_all">
  913. <yu-checkbox
  914. :indeterminate="isIndeterminate"
  915. v-model="checkAll"
  916. @change="handleCheckAllChange"
  917. >{{ $t("module.cb7fe08a-9867-48a8-96c4-c34dfc11a26d") }}
  918. </yu-checkbox>
  919. <yu-checkbox-group
  920. v-model="checkedRules"
  921. class="column_checkbox"
  922. @change="handleCheckedRulesChange"
  923. >
  924. <yu-checkbox v-for="rule in rules" :label="rule.id" :key="rule.id">
  925. <i :class="['iconfont_dms', rule.icon]"></i>
  926. <span>{{ rule.ruleDetail }}</span>
  927. </yu-checkbox>
  928. </yu-checkbox-group>
  929. </div>
  930. <div class="yu-grpButton" style="text-align: right">
  931. <yu-button @click="setRuleVisible = false">{{
  932. $t("module.2bdfa033-5b93-4d5c-aa8c-d487abc47907")
  933. }}</yu-button>
  934. <yu-button type="primary" @click="setRuleVisible = false">{{
  935. $t("module.ace7fe40-7c7c-4df1-a413-7c229e858a3e")
  936. }}</yu-button>
  937. </div>
  938. </yu-xdialog>
  939. </div>
  940. </template>
  941. <script>
  942. import "@/assets/dms/css/base.css";
  943. import { mapGetters } from "vuex";
  944. import mdCanvas from "@/views/content/dms/devconfig/components/mdCanvas";
  945. import modelEdit from "@/views/content/dms/config/components/modelEdit";
  946. import creatProject from "@/views/content/dms/devconfig/components/creatProject";
  947. import moduleTree from "@/views/content/dms/devconfig/components/moduleTree";
  948. import deleteModel from "@/views/content/dms/devconfig/components/deleteModel";
  949. import submitModels from "@/views/content/dms/devconfig/components/submitModels";
  950. import importModel from "@/views/content/dms/devconfig/components/importModel";
  951. import moduleTreeSimple from "@/views/content/dms/devconfig/components/moduleTreeSimple";
  952. import pubScript from "@/views/content/dms/devconfig/components/pubScript";
  953. import DialogLogicVersion from "@/views/content/dms/component/DialogLogicVersion";
  954. import consistencyCheck from "@/views/content/dms/devconfig/components/consistencyCheck";
  955. import stdsDeatil from "@/views/content/dms/devconfig/components/stdsDeatil";
  956. import mixin from "@/views/content/dms/devconfig/components/mixin/mdmixin";
  957. import valueNullVue from "../../../../idaYlmp/labelCenter/labelMass/components/valueNull.vue";
  958. export default {
  959. mixins: [mixin],
  960. components: {
  961. mdCanvas,
  962. modelEdit,
  963. creatProject,
  964. moduleTree,
  965. deleteModel,
  966. submitModels,
  967. importModel,
  968. moduleTreeSimple,
  969. pubScript,
  970. DialogLogicVersion,
  971. consistencyCheck,
  972. stdsDeatil,
  973. },
  974. props: {
  975. data: {
  976. type: Object,
  977. default: {},
  978. },
  979. projectConf: {
  980. type: Object,
  981. default: {},
  982. },
  983. },
  984. data: function () {
  985. return {
  986. scope: "all",
  987. copyModelFlag: false,
  988. ifStd: 0,
  989. activeTab: "",
  990. ids: "",
  991. deleteModuleDialog: false,
  992. checkBlue: false,
  993. moduleNameOps: [],
  994. selected: "",
  995. modelformdata: {},
  996. modelDialog: false,
  997. title: "",
  998. disabled: false,
  999. defaultArr: [],
  1000. modelEnRule: [
  1001. {
  1002. required: true,
  1003. message: this.$t("module.1a1b7a46-2fc7-4ecb-a1ad-64b5a3a595bc"),
  1004. },
  1005. ],
  1006. modelCnRule: [
  1007. {
  1008. required: true,
  1009. message: this.$t("module.5523b8e7-930a-4232-8dd1-c81d2de534cf"),
  1010. },
  1011. ],
  1012. formdata: {},
  1013. activeName: "basicInfors",
  1014. tableLoading: false,
  1015. url: {
  1016. addProjectModelUrl:
  1017. backend.modelDesignService + "/api/mdprojectmodel/addProjectModel", // 新增模块
  1018. updateProjectModelUrl:
  1019. backend.modelDesignService + "/api/mdprojectmodel/updateProjectModel", // 修改模块
  1020. checkRuleByModule:
  1021. backend.modelDesignService + "/api/rule/checkRuleByModule",
  1022. },
  1023. foreignKeyData: [],
  1024. indexData: [],
  1025. editModelDialog: false,
  1026. inFileTypeForm: {},
  1027. show: false,
  1028. fileList3: [],
  1029. isOrShow: true,
  1030. activeImp: 1,
  1031. dialogImport: false,
  1032. showDiv: false,
  1033. showDiv3: false,
  1034. msgg: this.$t("module.7e716b44-13f2-4ede-8953-1f44bab4e774"),
  1035. fileTypeForm: {},
  1036. uploadDialog: false,
  1037. dbTypeNameRule: [
  1038. {
  1039. required: true,
  1040. message: this.$t("module.95104c7b-ef81-4f10-bd22-dd74773e385a"),
  1041. },
  1042. ],
  1043. dbTypeDialog: false,
  1044. dbTypeForm: {},
  1045. showButFlag: false,
  1046. filterText: "",
  1047. height: yufp.custom.viewSize().height,
  1048. modelTypeVlue: "",
  1049. versionValue: {},
  1050. inFileOptions: [
  1051. {
  1052. key: "excel",
  1053. value: "excel",
  1054. },
  1055. ],
  1056. options: [
  1057. {
  1058. key: "EXCEL",
  1059. value: "EXCEL",
  1060. },
  1061. {
  1062. key: "DDL",
  1063. value: "DDL",
  1064. },
  1065. ],
  1066. modelType: [
  1067. {
  1068. key: "1",
  1069. value: this.$t("module.28474afe-7107-4c60-905b-a3e60ceb9fd3"),
  1070. },
  1071. {
  1072. key: "0",
  1073. value: this.$t("module.dadea369-5c3b-474e-a872-eb36cabbae4d"),
  1074. },
  1075. ],
  1076. projectDbType: "", // 数据类型
  1077. treeData: [],
  1078. type: "",
  1079. dbType: "",
  1080. dataRoot: {},
  1081. moduleId: "", // 模块Id
  1082. modelId: "", // 模型id
  1083. disable: false,
  1084. modelSubDialog: false,
  1085. modelData: [],
  1086. modelRoot: {},
  1087. moduleName: "",
  1088. fieldArr: [],
  1089. referFieldArr: [],
  1090. referTableArr: [],
  1091. defaultCheckedArr: [],
  1092. enlarge: "",
  1093. narrow: "",
  1094. dbTypeArr: [],
  1095. columnNameArr: [],
  1096. modelExportDialog: false,
  1097. defaultExportArr: [],
  1098. exportFlag: "excel",
  1099. userOps: [],
  1100. formdataSpace: {},
  1101. modelIdTrans: "",
  1102. treeClickCount: 0, // 模拟树节点双击事件
  1103. activeNum: 1,
  1104. diaHeight: 400, // 弹框高度,用于脚本信息sql语句区域高度动态计算,
  1105. observer1: null,
  1106. recordOldValue1: {
  1107. // 记录下旧的宽高数据,避免重复触发回调函数
  1108. width: "0",
  1109. height: "0",
  1110. },
  1111. observer2: null,
  1112. recordOldValue2: {
  1113. // 记录下旧的宽高数据,避免重复触发回调函数
  1114. width: "0",
  1115. height: "0",
  1116. },
  1117. showResult: false,
  1118. runResult: "",
  1119. versionId: "",
  1120. versionData: [],
  1121. checkedCount: 0,
  1122. sumCount: 0,
  1123. subModelCount: 0,
  1124. subModelSum: 0,
  1125. openTime: "",
  1126. addProjectVisible: false,
  1127. modelNameRule: [
  1128. {
  1129. required: true,
  1130. message: this.$t("module.5568dd45-8acd-4216-85d9-fcefeea21626"),
  1131. },
  1132. ],
  1133. schemaRule: [
  1134. {
  1135. required: true,
  1136. message: this.$t("module.641ebbd3-b0d5-40d1-b961-306cf11622fe"),
  1137. },
  1138. ],
  1139. modelCodeRule: [
  1140. {
  1141. required: true,
  1142. message: this.$t("module.5568dd45-8acd-4216-85d9-fcefeea21626"),
  1143. },
  1144. {
  1145. validator: yufp.validator.numberAndLetter,
  1146. },
  1147. ],
  1148. modelOrderRule: [
  1149. {
  1150. required: true,
  1151. message: this.$t("module.f8983a9d-44b8-46be-9147-e63b3f0c78f2"),
  1152. },
  1153. ],
  1154. currentModel: {},
  1155. modelShowFlag: yufp.util.dms.getWorkbenchState().viewMode,
  1156. autoLayoutCfgFlag: false,
  1157. autoLayoutCfg: {
  1158. n: 4,
  1159. rowHeight: 200,
  1160. },
  1161. changeModuleDialog: false,
  1162. changeMoudleData: [],
  1163. modelIds: "",
  1164. openTimeSub: "",
  1165. realIds: "",
  1166. openTimes: "",
  1167. otherData: {},
  1168. dbTypeForm: {}, //指定数据库类型
  1169. collExpand: "expend", //折叠展开状态 expend collapse
  1170. taskId: "", //任务id
  1171. taskStatus: {
  1172. 20: {
  1173. color: "iconkaifazhong dms-color1",
  1174. desc: this.$t("module.5c5f5452-6eff-41c6-8998-105cae0fc896"),
  1175. },
  1176. 30: {
  1177. color: "iconkaifawancheng dms-color3",
  1178. desc: this.$t("module.30464f91-bc9c-4a10-a309-16051a8fb305"),
  1179. },
  1180. 40: {
  1181. color: "iconshangxianchenggong dms-color3",
  1182. desc: this.$t("module.0aa9d7dc-1ab2-454d-ad6a-2b57579f71e3"),
  1183. },
  1184. 41: {
  1185. color: "iconshangxianshibai dms-color4",
  1186. desc: this.$t("module.69942d86-227b-48e9-b942-dc510b25176d"),
  1187. },
  1188. },
  1189. // dbTypeConfirm: false, //指定数据库类型弹框
  1190. getModelVisible: false,
  1191. pubScriptlVisible: false,
  1192. isViewModel: false, //是否视图模型
  1193. modelDisabled: false, // 模型编辑禁用标识
  1194. checkVisible: false,
  1195. statusTypeDb: "0",
  1196. sendStateOptions: [
  1197. {
  1198. key: "0",
  1199. value: this.$t("module.395bc575-a034-412b-998d-3b0e3bf7b153"),
  1200. },
  1201. {
  1202. key: "1",
  1203. value: this.$t("module.1e8de85d-b761-4f9a-bfe9-aa7b1749e952"),
  1204. },
  1205. ],
  1206. stdInFlag: false,
  1207. statusTypeDb: "0",
  1208. treeLoading: false,
  1209. commonStd: [],
  1210. personStd: [],
  1211. filterStd: "",
  1212. stdTailVisible: false,
  1213. stdMenuId: "",
  1214. drawer: false,
  1215. rulesTypeOptions: [
  1216. {
  1217. key: "ERROR",
  1218. value: this.$t("module.c031d319-90c5-49b6-88ac-ac403ea32291"),
  1219. },
  1220. {
  1221. key: "WARNING",
  1222. value: this.$t("module.dab2fec4-efa1-44c1-96f9-7773d77dbb9d"),
  1223. },
  1224. {
  1225. key: "HINTING",
  1226. value: this.$t("module.a4d141fa-8dbd-48b5-bb1b-6e980fd7e477"),
  1227. },
  1228. ],
  1229. tableData: [],
  1230. activeRealDeatil: "ERROR",
  1231. checkedRules: [], // 选择的规则
  1232. rules: [], // 所有待选的规则
  1233. setRuleVisible: false,
  1234. allCheckedResult: {}, // 所有的检查结果
  1235. isIndeterminate: true,
  1236. checkAll: true,
  1237. rulesType: [],
  1238. checkVisible: false,
  1239. stdDrawer: false,
  1240. typeClass: {
  1241. ERROR: "iconcuowu1",
  1242. WARNING: "iconjinggao1",
  1243. HINTING: "iconxinxi",
  1244. },
  1245. wsId: yufp.util.dms.getCurrentWs().wsId,
  1246. nodeLevel: "",
  1247. };
  1248. },
  1249. computed: {
  1250. ...mapGetters(["projectId", "projectName"]),
  1251. },
  1252. watch: {
  1253. scope: {
  1254. handler(val, oldVal) {
  1255. if (val) {
  1256. this.queryleftTree();
  1257. }
  1258. },
  1259. },
  1260. // 项目切换之后重新查询项目树,查询数据类型
  1261. projectId: {
  1262. immediate: true,
  1263. handler: function (val) {
  1264. this.exportIncreFn("edit"); // 查询版本数据查询版本数据
  1265. this.queryPromodelListFn();
  1266. },
  1267. },
  1268. projectConf: {
  1269. // immediate: true,
  1270. handler: function (val) {
  1271. if (!this.projectConf.ifStd || this.projectConf.ifStd == 0) {
  1272. this.ifStd = 0;
  1273. } else {
  1274. this.ifStd = 1;
  1275. }
  1276. },
  1277. },
  1278. filterStd: {
  1279. handler: function (val, oldVal) {
  1280. this.$refs.stdRef[this.statusTypeDb].filter(val); // 通过 filterNode 筛选树数据
  1281. },
  1282. },
  1283. },
  1284. methods: {
  1285. // 数据标准树 双击打开标准详情
  1286. nodeDbClick(data, node, element) {
  1287. // data.id 节点地
  1288. if (data.level == "M") {
  1289. return;
  1290. }
  1291. this.stdTailVisible = true;
  1292. this.openTime = Date.parse(new Date()) + "";
  1293. this.stdMenuId = data.id;
  1294. },
  1295. addStdFn() {
  1296. this.filterStd = "";
  1297. this.stdDrawer = !this.stdDrawer;
  1298. this.drawer = false;
  1299. // this.modelDrawer = false;
  1300. this.statusTypeDb = "0";
  1301. this.treeLoading = true;
  1302. this.getStd({ wsId: this.wsId }).then((datas) => {
  1303. this.commonStd = this.stdata = datas;
  1304. });
  1305. this.getStd().then((datas) => {
  1306. this.treeLoading = false;
  1307. this.personStd = datas;
  1308. });
  1309. },
  1310. filterNode(value, data) {
  1311. if (!value) return true;
  1312. return data.name.indexOf(value) !== -1;
  1313. },
  1314. addCheckFn() {
  1315. this.drawer = !this.drawer;
  1316. this.stdDrawer = false;
  1317. // this.modelDrawer = false;
  1318. this.rulesType = [];
  1319. this.rulesTypeOptions.forEach((item) => {
  1320. let obj = {};
  1321. obj = {
  1322. key: item.key,
  1323. value:
  1324. item.value +
  1325. "(" +
  1326. (this.allCheckedResult[item.key]
  1327. ? this.allCheckedResult[item.key].length
  1328. : 0) +
  1329. ")",
  1330. };
  1331. this.rulesType.push(obj);
  1332. });
  1333. console.log("this.rulesType", this.rulesType);
  1334. },
  1335. handleClick() {
  1336. this.tableData = this.allCheckedResult
  1337. ? this.allCheckedResult[this.activeRealDeatil]
  1338. : [];
  1339. },
  1340. // 模型定位
  1341. checkModel(row) {
  1342. this.$refs.mdCanvas.focusItem(row.modelId);
  1343. },
  1344. handleCheckAllChange: function (event) {
  1345. this.checkedRules = event.target.checked
  1346. ? this.rules.map((item) => {
  1347. return item.id;
  1348. })
  1349. : [];
  1350. this.isIndeterminate = false;
  1351. },
  1352. handleCheckedRulesChange: function (value) {
  1353. let checkedCount = value.length;
  1354. this.checkAll = checkedCount === this.rules.length;
  1355. this.isIndeterminate =
  1356. checkedCount > 0 && checkedCount < this.rules.length;
  1357. },
  1358. // 开始检查
  1359. startCheck() {
  1360. this.rulesType = [];
  1361. yufp.service.request({
  1362. method: "post",
  1363. url:
  1364. this.url.checkRuleByModule +
  1365. "?moduleId=" +
  1366. this.moduleId +
  1367. "&versionCode=" +
  1368. this.versionValue.versionCode,
  1369. data: JSON.stringify(this.checkedRules),
  1370. callback: (code, message, response) => {
  1371. if (response.code === 200) {
  1372. if (response.data && response.data.length) {
  1373. this.allCheckedResult = this.handleSameTypeGroup(
  1374. response.data,
  1375. "type",
  1376. "errorType"
  1377. );
  1378. this.rulesTypeOptions.forEach((item) => {
  1379. let obj = {};
  1380. obj = {
  1381. key: item.key,
  1382. value:
  1383. item.value +
  1384. "(" +
  1385. (this.allCheckedResult[item.key]
  1386. ? this.allCheckedResult[item.key].length
  1387. : 0) +
  1388. ")",
  1389. };
  1390. this.rulesType.push(obj);
  1391. });
  1392. this.tableData = this.allCheckedResult
  1393. ? this.allCheckedResult[this.activeRealDeatil] || []
  1394. : [];
  1395. }
  1396. } else {
  1397. this.$message.error(response.message);
  1398. }
  1399. },
  1400. });
  1401. },
  1402. // 一致性检查
  1403. checkUniformity() {
  1404. this.checkVisible = true;
  1405. },
  1406. checkRules() {
  1407. this.setRuleVisible = true;
  1408. console.log("setRuleVisible", this.rules);
  1409. },
  1410. renderContentStd: function (h, { node, data, store }) {
  1411. let _this = this;
  1412. let callOver = (e) => {
  1413. e.stopPropagation();
  1414. _this.drag(e, data);
  1415. };
  1416. return h(
  1417. "span",
  1418. {
  1419. on: { dragstart: callOver },
  1420. attrs: {
  1421. class: "el-tree-node__label",
  1422. title: data.label, // FIXME
  1423. draggable: true,
  1424. },
  1425. style: { cursor: "move" },
  1426. },
  1427. data.label
  1428. );
  1429. },
  1430. // 接口拖拽
  1431. drag(ev, field) {
  1432. // 自定义标准时
  1433. if (this.statusTypeDb == "1") {
  1434. field.wsId = this.wsId;
  1435. }
  1436. ev.dataTransfer.setData("stdData", JSON.stringify(field));
  1437. },
  1438. closeRight() {
  1439. // this.stdInFlag = false;
  1440. },
  1441. customSearchFn() {
  1442. this.filterStd = "";
  1443. // let param = {type:1};
  1444. // if (this.statusTypeDb == '1') {
  1445. // param.wsId = this.wsId;
  1446. // param.type=0
  1447. // }
  1448. // this.getStd(param).then((datas) => {
  1449. // this.stdata = datas;
  1450. // });
  1451. this.statusTypeDb == "0"
  1452. ? (this.stdata = this.commonStd)
  1453. : (this.stdata = this.personStd);
  1454. },
  1455. // 展开/折叠
  1456. closeOrOpen() {
  1457. this.refreshTable = false;
  1458. this.isExpandAll = !this.isExpandAll;
  1459. if (!this.isExpandAll) {
  1460. this.defaultArr = [];
  1461. }
  1462. this.$nextTick(() => {
  1463. this.refreshTable = true;
  1464. });
  1465. },
  1466. closeBack() {
  1467. this.pubScriptlVisible = false;
  1468. },
  1469. publishScript() {
  1470. this.pubScriptlVisible = true;
  1471. this.$nextTick(() => {
  1472. this.$refs.pubScriptRef.publishScript();
  1473. });
  1474. },
  1475. //拉取模型 - master
  1476. getModelFromMaster() {
  1477. this.getModelVisible = true;
  1478. this.$nextTick(() => {
  1479. this.$refs.getModelRef.filterText = "";
  1480. this.$refs.getModelRef.queryModelList();
  1481. });
  1482. },
  1483. getModel: function () {
  1484. this.$refs.getModelRef.saveFn();
  1485. },
  1486. getModelBack() {
  1487. this.getModelVisible = false;
  1488. this.backDeal();
  1489. },
  1490. //拉取模型 - LOGIC
  1491. getModelFromLogic() {
  1492. this.$refs.logicDialogRef.open();
  1493. },
  1494. // 任务切换
  1495. taskChange() {},
  1496. backDeal() {
  1497. this.$refs.mdCanvas.init();
  1498. // 提交之后刷新树
  1499. this.queryModelList();
  1500. },
  1501. closeFn() {
  1502. this.modelSubDialog = false;
  1503. },
  1504. //关闭复制模型窗口
  1505. backFormCopy() {
  1506. this.copyModelFlag = false;
  1507. this.$refs.mdCanvas.init();
  1508. this.queryleftTree();
  1509. },
  1510. clickBut: function () {
  1511. if ($(".dms-bodys").hasClass("nav_is_visible") == true) {
  1512. this.collExpand = "collapse";
  1513. $(".dms-bodys").removeClass("nav_is_visible");
  1514. $(".trangle").removeClass("trangle-left");
  1515. $(".trangle").addClass("trangle-right");
  1516. } else {
  1517. this.collExpand = "expend";
  1518. $(".dms-bodys").addClass("nav_is_visible");
  1519. $(".trangle").removeClass("trangle-right");
  1520. $(".trangle").addClass("trangle-left");
  1521. }
  1522. },
  1523. refQuery: function () {
  1524. this.queryModelList();
  1525. this.$refs.mdCanvas.init();
  1526. // 删除之后清空已选中数量
  1527. this.$refs.menuTree.setCheckedKeys([]);
  1528. this.deleteModuleDialog = false;
  1529. },
  1530. // getLevel
  1531. getLevel: function (val) {
  1532. let obj = this.treeData.find((obj) => {
  1533. return obj.id == val;
  1534. });
  1535. return obj;
  1536. },
  1537. valueChange: function (val) {
  1538. let blueData = [];
  1539. for (let item of this.treeData) {
  1540. if (item.level == "C" && item.modelState == "0") {
  1541. blueData.push(item.id);
  1542. }
  1543. }
  1544. if (this.checkBlue) {
  1545. // 覆盖
  1546. let selectedKeys = this.$refs.menuTree.getCheckedKeys(); // 已经勾选数据
  1547. let concatData = blueData.concat(selectedKeys);
  1548. let arrAll = new Set(concatData); // 去重
  1549. this.$refs.menuTree.setCheckedKeys(arrAll);
  1550. this.checkedCount = blueData.length;
  1551. } else {
  1552. let selectedKeys = this.$refs.menuTree.getCheckedKeys();
  1553. let unRepeaData = [];
  1554. for (let itemRe of selectedKeys) {
  1555. let itemObj = this.getLevel(itemRe);
  1556. if (blueData.indexOf(itemRe) == -1 && itemObj.level == "C") {
  1557. unRepeaData.push(itemRe);
  1558. }
  1559. }
  1560. this.$refs.menuTree.setCheckedKeys(unRepeaData);
  1561. this.checkedCount = unRepeaData.length;
  1562. }
  1563. },
  1564. changeFun: function () {
  1565. let selectArr = this.$refs.menuTree.getCheckedNodes();
  1566. let realArr = [],
  1567. realIdArr = [];
  1568. // 剔除根节点数据
  1569. realArr = this.filteModelFn(selectArr);
  1570. if (realArr.length == 0) {
  1571. this.$message({
  1572. type: "warning",
  1573. message: this.$t("module.944d1af0-d439-4881-b856-e65ca6028eb9"),
  1574. });
  1575. return;
  1576. }
  1577. for (let item of realArr) {
  1578. if (item.modelState !== 1) {
  1579. // 过滤状态为 待审批的数据
  1580. realIdArr.push(item.id);
  1581. }
  1582. }
  1583. if (realIdArr.length == 0) {
  1584. this.$message({
  1585. type: "warning",
  1586. message: this.$t("module.bdc42479-b338-49e5-aca0-a7cb398f63dc"),
  1587. });
  1588. return;
  1589. }
  1590. this.modelIds = realIdArr.join(",");
  1591. this.changeModuleDialog = true; // 模型转移
  1592. },
  1593. copyFun: function () {
  1594. let selectArr = this.$refs.menuTree.getCheckedNodes();
  1595. let realArr = [],
  1596. realIdArr = [];
  1597. // 剔除根节点数据
  1598. realArr = this.filteModelFn(selectArr);
  1599. if (realArr.length == 0) {
  1600. this.$message({
  1601. type: "warning",
  1602. message: this.$t("module.a2a01a24-1489-45e5-bb5c-67ac9d336612"),
  1603. });
  1604. return;
  1605. }
  1606. for (let item of realArr) {
  1607. realIdArr.push(item.id);
  1608. }
  1609. this.modelIds = realIdArr.join(",");
  1610. this.copyModelFlag = true; // 模型复制
  1611. },
  1612. closeChangeModule: function () {
  1613. this.changeModuleDialog = false;
  1614. this.queryModelList();
  1615. this.$refs.mdCanvas.init();
  1616. },
  1617. // 获取模块列表
  1618. queryPromodelListFn: function () {
  1619. return new Promise((resolve, reject) => {
  1620. yufp.service.request({
  1621. method: "GET",
  1622. url:
  1623. backend.modelDesignService + "/api/mdprojectmodel/queryModuleTree",
  1624. data: {
  1625. projectId: yufp.sessionStorage.get("projectId"),
  1626. },
  1627. callback: (code, message, response) => {
  1628. if (response.code === 200) {
  1629. // this.moduleNameOps = response.data;
  1630. this.moduleNameOps = [];
  1631. let menuArr = [];
  1632. let menus = response.data;
  1633. spread(menus);
  1634. function spread(menus) {
  1635. for (let i = 0; i < menus.length; i++) {
  1636. let menu = {};
  1637. menu = menus[i];
  1638. if (menu.childList) {
  1639. spread(menu.childList);
  1640. delete menu.childList;
  1641. }
  1642. menuArr.push(menu);
  1643. }
  1644. }
  1645. this.moduleNameOps = menuArr;
  1646. resolve();
  1647. } else {
  1648. this.$message({
  1649. type: "error",
  1650. message: response.message,
  1651. });
  1652. }
  1653. },
  1654. });
  1655. });
  1656. },
  1657. closeCrePro: function () {
  1658. this.addProjectVisible = false;
  1659. },
  1660. // 模型新建之后重新查询项目
  1661. backDo: function () {},
  1662. toModelTable: function () {
  1663. let versionValue = this.versionValue;
  1664. if (!versionValue || JSON.stringify(versionValue) === "{}")
  1665. versionValue = this.data.versionValue;
  1666. versionValue = yufp.clone(versionValue, {});
  1667. yufp.util.dms.globalVm.$emit("viewAndList", "list", { versionValue });
  1668. },
  1669. // 多选框触发事件
  1670. nodeCheck: function (obj, flag1, flag2) {
  1671. if (obj.level == "A") {
  1672. // 取消全选时取消勾选草稿
  1673. if (!flag1) {
  1674. this.checkBlue = false;
  1675. } else {
  1676. this.checkBlue = true;
  1677. }
  1678. }
  1679. let realArr = [];
  1680. this.changeMoudleData = []; // 数据清空
  1681. let selectArr = this.$refs.menuTree.getCheckedNodes();
  1682. realArr = this.filteModelFn(selectArr);
  1683. this.changeMoudleData = realArr;
  1684. this.checkedCount = realArr.length;
  1685. },
  1686. nodeCheckSub: function () {
  1687. let realArr = [];
  1688. let selectArr = this.$refs.modelTree.getCheckedNodes();
  1689. realArr = this.filteModelFn(selectArr);
  1690. this.subModelCount = realArr.length;
  1691. },
  1692. // 批量删除模型
  1693. batchDeleteModels: function () {
  1694. let selectArr = this.$refs.menuTree.getCheckedNodes();
  1695. let realArr = [],
  1696. realIdArr = [],
  1697. realId = "";
  1698. realArr = this.filteModelFn(selectArr);
  1699. if (realArr.length == 0) {
  1700. this.$message({
  1701. type: "warning",
  1702. message: this.$t("module.e1f41b70-4001-4520-a489-2ec306bb3e8e"),
  1703. });
  1704. return;
  1705. }
  1706. for (let item of realArr) {
  1707. if (item.modelState !== 1) {
  1708. realIdArr.push(item.id);
  1709. }
  1710. }
  1711. if (realIdArr.length == 0) {
  1712. this.$message({
  1713. type: "warning",
  1714. message: this.$t("module.bdc42479-b338-49e5-aca0-a7cb398f63dc"),
  1715. });
  1716. return;
  1717. }
  1718. realId = realIdArr.join(",");
  1719. this.$confirm(
  1720. this.$t("module.8109179d-cf20-4444-af9b-eb2fbe6f0425"),
  1721. this.$t("dms.33899853-ae9d-4c62-af1d-30f428348826"),
  1722. {
  1723. confirmButtonText: this.$t(
  1724. "module.e1f5797b-071e-41a2-9ca4-421b32458c6e"
  1725. ),
  1726. cancelButtonText: this.$t(
  1727. "module.de26e309-74a6-48ce-8fa4-c37cb63cf622"
  1728. ),
  1729. type: "warning",
  1730. callback: (action) => {
  1731. if (action === "confirm") {
  1732. this.ids = realId;
  1733. this.openTime = Date.parse(new Date()) + "";
  1734. this.deleteModuleDialog = true;
  1735. } else {
  1736. this.$message({
  1737. message: this.$t("module.e87a6fd0-100c-4b8b-ada6-3d8fb852c220"),
  1738. type: "info",
  1739. });
  1740. }
  1741. },
  1742. }
  1743. );
  1744. },
  1745. queryTreeByVersion: function (val) {
  1746. // 进入可编辑状态
  1747. if (this.projectId && this.projectId !== "") {
  1748. this.projectDbType = val.dbType;
  1749. this.queryleftTree();
  1750. return;
  1751. }
  1752. },
  1753. jumpToDataCigen: function () {
  1754. let customKey = "custom-gm-43000"; // 请以custom_前缀开头,并且全局唯一
  1755. let routeId = "dataRoots"; // 模板示例->普通查询的路由ID
  1756. yufp.router.addRoute(routeId, {
  1757. html: "pages/deveEngineer/deveDataRoot/deveDataRoot.html",
  1758. js: "pages/deveEngineer/deveDataRoot/deveDataRoot.js",
  1759. });
  1760. yufp.frame.addTab({
  1761. id: routeId, // 菜单功能ID(路由ID)
  1762. key: customKey, // 自定义唯一页签key,请统一使用custom_前缀开头
  1763. title: this.$t("module.aa325499-1937-4a79-9966-2a402508feed"), // 页签名称
  1764. data: {
  1765. flag: "workbench",
  1766. }, // 传递的业务数据,可选配置
  1767. });
  1768. },
  1769. jumpToDataStd: function () {
  1770. let customKey = "custom-gm-42000"; // 请以custom_前缀开头,并且全局唯一
  1771. let routeId = "sumDataStandards"; // 模板示例->普通查询的路由ID
  1772. yufp.router.addRoute(routeId, {
  1773. html: "pages/deveEngineer/developerDataStd/developerDataStd.html",
  1774. js: "pages/deveEngineer/developerDataStd/developerDataStd.js",
  1775. });
  1776. yufp.frame.addTab({
  1777. id: routeId, // 菜单功能ID(路由ID)
  1778. key: customKey, // 自定义唯一页签key,请统一使用custom_前缀开头
  1779. title: this.$t("module.7bf2e647-88dd-4de9-bcb3-34d85e783ee8"), // 页签名称
  1780. data: {
  1781. flag: "workbench",
  1782. }, // 传递的业务数据,可选配置
  1783. });
  1784. },
  1785. jumpToDataType: function () {
  1786. let customKey = "custom-gm-30000"; // 请以custom_前缀开头,并且全局唯一
  1787. let routeId = "dataFieldMapping"; // 模板示例->普通查询的路由ID
  1788. yufp.router.addRoute(routeId, {
  1789. html: "pages/sysAdministrator/dataFieldMapping/dataFieldMapping.html",
  1790. js: "pages/sysAdministrator/dataFieldMapping/dataFieldMapping.js",
  1791. });
  1792. yufp.frame.addTab({
  1793. id: routeId, // 菜单功能ID(路由ID)
  1794. key: customKey, // 自定义唯一页签key,请统一使用custom_前缀开头
  1795. title: this.$t("module.389838b5-cacd-491c-8a82-88dcdb82325a"), // 页签名称
  1796. data: {
  1797. flag: "workbench",
  1798. }, // 传递的业务数据,可选配置
  1799. });
  1800. },
  1801. // 应对模型树 模型名称过长的情况的处理
  1802. renderContent: function (h, data) {
  1803. if (["30", "40"].includes(this.versionValue.jobStatus)) {
  1804. return h(
  1805. "span",
  1806. {
  1807. attrs: {
  1808. title: data.node.label,
  1809. },
  1810. },
  1811. data.node.label
  1812. );
  1813. } else {
  1814. // 给根节点增加两个图标-- 新增模块 新增scame
  1815. if (data.data.level == "A") {
  1816. let btnArray = [
  1817. {
  1818. name: this.$t("module.b2566c2d-46b8-4f16-9d42-3fa8f5307f36"),
  1819. className: "iconfont_dms iconxinzeng1",
  1820. show: true,
  1821. callback: (e) => {
  1822. this.title = this.$t(
  1823. "module.b2566c2d-46b8-4f16-9d42-3fa8f5307f36"
  1824. );
  1825. this.addMenu(data);
  1826. e.stopPropagation();
  1827. },
  1828. },
  1829. ];
  1830. return h(
  1831. "span",
  1832. {
  1833. class: "dms-tree-btn",
  1834. },
  1835. [
  1836. h(
  1837. "span",
  1838. {
  1839. class: "tit",
  1840. attrs: {
  1841. title: data.node.label,
  1842. },
  1843. },
  1844. data.node.label
  1845. ),
  1846. h(
  1847. "span",
  1848. {
  1849. class: "btn",
  1850. },
  1851. [
  1852. btnArray.map((item) => {
  1853. return h(
  1854. "i",
  1855. {
  1856. class: item.className,
  1857. on: {
  1858. click: item.callback,
  1859. },
  1860. attrs: {
  1861. title: item.name,
  1862. },
  1863. },
  1864. ""
  1865. );
  1866. }),
  1867. ]
  1868. ),
  1869. ]
  1870. );
  1871. }
  1872. if (data.data.level == "B") {
  1873. let btnArray = [
  1874. {
  1875. name: this.$t("module.8ccabb36-0ab0-41e4-a845-8929aaea783f"),
  1876. className: "iconfont_dms iconmd-edit",
  1877. show: true,
  1878. callback: (e) => {
  1879. this.title = this.$t(
  1880. "module.8ccabb36-0ab0-41e4-a845-8929aaea783f"
  1881. );
  1882. this.nodeEdit(data);
  1883. e.stopPropagation();
  1884. },
  1885. },
  1886. {
  1887. name: this.$t("module.b2566c2d-46b8-4f16-9d42-3fa8f5307f36"),
  1888. className: "iconfont_dms iconxinzeng1",
  1889. show: true,
  1890. callback: (e) => {
  1891. this.title = this.$t(
  1892. "module.b2566c2d-46b8-4f16-9d42-3fa8f5307f36"
  1893. );
  1894. this.addMenu(data);
  1895. e.stopPropagation();
  1896. },
  1897. },
  1898. {
  1899. name: this.$t("module.6bac5bc5-2152-4f0b-9ab1-d2bb9018cc83"),
  1900. // className: "iconfont_dms iconshanchu",
  1901. className: "el-icon-delete",
  1902. show: true,
  1903. callback: (e) => {
  1904. this.nodeDelete(data);
  1905. this.title = this.$t(
  1906. "module.6bac5bc5-2152-4f0b-9ab1-d2bb9018cc83"
  1907. );
  1908. e.stopPropagation();
  1909. },
  1910. },
  1911. ];
  1912. return h(
  1913. "span",
  1914. {
  1915. class: "dms-tree-btn",
  1916. },
  1917. [
  1918. h(
  1919. "span",
  1920. {
  1921. class: "tit",
  1922. attrs: {
  1923. title: data.node.label,
  1924. },
  1925. },
  1926. data.node.label
  1927. ),
  1928. h(
  1929. "span",
  1930. {
  1931. class: "btn",
  1932. },
  1933. [
  1934. btnArray.map((item) => {
  1935. return h(
  1936. "i",
  1937. {
  1938. class: item.className,
  1939. on: {
  1940. click: item.callback,
  1941. },
  1942. attrs: {
  1943. title: item.name,
  1944. },
  1945. },
  1946. ""
  1947. );
  1948. }),
  1949. ]
  1950. ),
  1951. ]
  1952. );
  1953. }
  1954. if (data.data.level == "C") {
  1955. return h("span", {}, data.node.label);
  1956. }
  1957. }
  1958. },
  1959. saveTreeFn: function () {
  1960. let validate = false;
  1961. this.$refs.modelformRef.validate((valid) => {
  1962. validate = valid;
  1963. });
  1964. if (!validate) {
  1965. return;
  1966. }
  1967. let url = "";
  1968. if (this.selected) {
  1969. this.modelformdata.pmodelid = this.selected;
  1970. } else {
  1971. if (this.modelformdata.pmodelid) {
  1972. delete this.modelformdata.pmodelid;
  1973. }
  1974. }
  1975. if (
  1976. this.title === this.$t("module.b2566c2d-46b8-4f16-9d42-3fa8f5307f36")
  1977. ) {
  1978. url = this.url.addProjectModelUrl;
  1979. this.modelformdata.projectId = this.projectId;
  1980. } else if (
  1981. this.title === this.$t("module.8ccabb36-0ab0-41e4-a845-8929aaea783f")
  1982. ) {
  1983. url = this.url.updateProjectModelUrl;
  1984. this.modelformdata.id = this.currentModel.data.id;
  1985. this.modelformdata.projectId = this.projectId;
  1986. }
  1987. yufp.service.request({
  1988. method: "POST",
  1989. url: url,
  1990. data: this.modelformdata,
  1991. callback: (code, message, response) => {
  1992. if (response.code === 0 || response.code === 200) {
  1993. this.modelDialog = false;
  1994. this.queryModelList();
  1995. this.$message({
  1996. type: "success",
  1997. message: this.$t("module.3daacc8a-0968-4123-a712-8745f89c4682"),
  1998. });
  1999. } else {
  2000. this.$message({
  2001. type: "error",
  2002. message: response.message,
  2003. });
  2004. }
  2005. },
  2006. });
  2007. },
  2008. addMenu: function (data) {
  2009. let row = data.data;
  2010. this.modelDialog = true;
  2011. this.queryPromodelListFn().then(() => {
  2012. if (row.level !== "A") {
  2013. // 一级节点 -- 项目节点 新增时不传pmoduleId
  2014. this.selected = row.id;
  2015. } else {
  2016. this.selected = "";
  2017. }
  2018. });
  2019. this.$nextTick(() => {
  2020. this.$refs.modelformRef.resetFields();
  2021. });
  2022. },
  2023. nodeEdit: function (data) {
  2024. let row = data.data;
  2025. this.modelDialog = true;
  2026. this.$nextTick(() => {
  2027. this.currentModel = data;
  2028. if (row.parentId !== this.projectId) {
  2029. // 父节点是项目
  2030. this.selected = row.parentId;
  2031. } else {
  2032. this.selected = "";
  2033. }
  2034. this.modiModuld = row.id;
  2035. this.modelformdata.modelName = row.name;
  2036. this.modelformdata.modelCode = row.modelCode;
  2037. this.modelformdata.schemaName = row.schema;
  2038. this.modelformdata.modelDesc = row.modelDesc;
  2039. this.modelformdata.modelOrder = row.modelOrder;
  2040. this.queryPromodelListFn();
  2041. });
  2042. },
  2043. nodeDelete: function (data) {
  2044. let row = data.data;
  2045. this.$confirm(
  2046. this.$t("module.aa186ad8-6940-4ad1-902e-6cca7c795487"),
  2047. this.$t("dms.33899853-ae9d-4c62-af1d-30f428348826"),
  2048. {
  2049. confirmButtonText: this.$t(
  2050. "module.e1f5797b-071e-41a2-9ca4-421b32458c6e"
  2051. ),
  2052. cancelButtonText: this.$t(
  2053. "module.de26e309-74a6-48ce-8fa4-c37cb63cf622"
  2054. ),
  2055. type: "warning",
  2056. callback: (action) => {
  2057. if (action === "confirm") {
  2058. yufp.service.request({
  2059. method: "POST",
  2060. url:
  2061. backend.modelDesignService +
  2062. "/api/mdprojectmodel/delete/" +
  2063. row.id,
  2064. callback: (code, message, response) => {
  2065. if (response.code === 0 || response.code === 200) {
  2066. this.queryModelList();
  2067. this.$message({
  2068. type: "success",
  2069. message: this.$t(
  2070. "module.3daacc8a-0968-4123-a712-8745f89c4682"
  2071. ),
  2072. });
  2073. } else {
  2074. this.$message({
  2075. type: "error",
  2076. message: response.message,
  2077. });
  2078. }
  2079. },
  2080. });
  2081. } else {
  2082. this.$message({
  2083. message: this.$t("module.e87a6fd0-100c-4b8b-ada6-3d8fb852c220"),
  2084. type: "info",
  2085. });
  2086. }
  2087. },
  2088. }
  2089. );
  2090. },
  2091. // 获取成员列表
  2092. getUserListFn: function () {
  2093. yufp.service.request({
  2094. method: "GET",
  2095. url: backend.modelDesignService + "/api/mduser/qryUserByProNotSelf",
  2096. data: {
  2097. projectId: this.projectId,
  2098. },
  2099. callback: (code, message, response) => {
  2100. if (response.code === 200) {
  2101. for (let i = 0; i < response.data.length; i++) {
  2102. this.userOps.push({});
  2103. this.userOps[i].key = response.data[i].userId;
  2104. this.userOps[i].value =
  2105. response.data[i].nickname + " (" + response.data[i].tel + ")";
  2106. }
  2107. } else {
  2108. this.$message({
  2109. type: "error",
  2110. message: response.message,
  2111. });
  2112. }
  2113. },
  2114. });
  2115. },
  2116. handleCommand: function (command) {
  2117. if (command == "png") {
  2118. this.exportPng();
  2119. } else if (command == "word") {
  2120. this.exportWord();
  2121. }
  2122. },
  2123. exportWord() {
  2124. this.$message({
  2125. message: this.$t("module.c03fd547-19f8-4440-b36a-aa396d3e0ca0"),
  2126. });
  2127. let url =
  2128. "/api/word/exportWordByModelId" +
  2129. "?projectId=" +
  2130. this.projectId +
  2131. "&versionCode=" +
  2132. this.versionValue.versionCode +
  2133. "&token=" +
  2134. yufp.service.getToken();
  2135. yufp.util.download(backend.modelDesignService + url);
  2136. },
  2137. // 导出Excel
  2138. export: function () {
  2139. this.modelExportDialog = true;
  2140. },
  2141. // 导入成功回调查询数据
  2142. callBackFun: function () {
  2143. this.$refs.mdCanvas.init(); // 画布刷新
  2144. this.queryModelList();
  2145. },
  2146. // 刷新画布
  2147. refreshCanvas() {
  2148. this.$refs.mdCanvas.init();
  2149. },
  2150. // 显示比例
  2151. mouseOver: function (val) {
  2152. let values = this.$refs.mdCanvas.getCurZoom();
  2153. if (val == "enlarge") {
  2154. this.enlarge = values + "";
  2155. } else if (val == "narrow") {
  2156. this.narrow = values + "";
  2157. }
  2158. },
  2159. // 画布放大缩小
  2160. largeOrSmall: function (val) {
  2161. if (val == "enlarge") {
  2162. this.$refs.mdCanvas.zoomIn();
  2163. } else if (val == "narrow") {
  2164. this.$refs.mdCanvas.zoomOut();
  2165. }
  2166. // 画布放大缩小之后实时更新比例
  2167. this.mouseOver(val);
  2168. },
  2169. // 关闭模型编辑弹框之前触发画布刷新
  2170. closeDialog: function () {
  2171. this.editModelDialog = false;
  2172. this.$refs.modelEdit.releaseAuth();
  2173. if (!this.disabled) {
  2174. this.$refs.mdCanvas.updateModelOnClose(this.modelId);
  2175. this.queryModelList();
  2176. }
  2177. },
  2178. // 导出图片
  2179. exportPng: function () {
  2180. this.$refs.mdCanvas.exportPng();
  2181. },
  2182. cancelEditFn: function () {
  2183. this.editModelDialog = false;
  2184. if (!this.disabled) {
  2185. this.$refs.mdCanvas.updateModelOnClose(this.modelId);
  2186. }
  2187. },
  2188. // 树节点点击
  2189. nodeClickFn: function (nodeData, node, self) {
  2190. // 取得节点层级 在画布组件用
  2191. this.nodeLevel = nodeData.level;
  2192. if (nodeData.level == "A") {
  2193. this.isViewModel = true;
  2194. } else {
  2195. this.isViewModel = false;
  2196. }
  2197. if (nodeData.level == "A") {
  2198. this.$refs.mdCanvas.initProject(nodeData.id);
  2199. }
  2200. if (nodeData.level == "B") {
  2201. this.moduleId = nodeData.id;
  2202. // this.moduleName = nodeData.name;
  2203. this.$nextTick(() => {
  2204. this.$refs.menuTree.setCurrentKey(nodeData.id);
  2205. this.defaultArr = [nodeData.id];
  2206. });
  2207. } else if (nodeData.level == "C") {
  2208. this.moduleId = nodeData.parentId;
  2209. // 记录点击次数
  2210. this.treeClickCount++;
  2211. // 单次点击次数超过2次不作处理,直接返回
  2212. if (this.treeClickCount >= 2) {
  2213. return;
  2214. }
  2215. // 计时器,计算300毫秒为单位,可自行修改
  2216. this.timer = window.setTimeout(() => {
  2217. if (this.treeClickCount == 1) {
  2218. // 单击事件 画布聚焦
  2219. this.treeClickCount = 0; // 把次数归零
  2220. this.$refs.mdCanvas.focusItem(nodeData.id);
  2221. } else if (this.treeClickCount > 1) {
  2222. // 双击事件 弹出模型编辑框
  2223. this.treeClickCount = 0;
  2224. let row = {
  2225. modelId: nodeData.id,
  2226. flag: this.versionValue.versionCode === "master",
  2227. };
  2228. this.preEditModel(row);
  2229. }
  2230. }, 300);
  2231. }
  2232. },
  2233. // 搜索模型查询
  2234. queryModelList: function () {
  2235. if (!this.versionValue || !this.versionValue.versionCode) {
  2236. return;
  2237. }
  2238. this.sumCount = 0; // 先清空
  2239. // 新需求-- 查询去掉condition search 接受查询条件
  2240. let param = {
  2241. projectId: this.projectId,
  2242. version: this.versionValue.versionCode,
  2243. scope: this.scope,
  2244. withModel: true,
  2245. projectName: this.projectName,
  2246. };
  2247. if (this.filterText) {
  2248. param.search = this.filterText;
  2249. }
  2250. let expendLevelCData = [];
  2251. yufp.service.request({
  2252. method: "get",
  2253. url: backend.modelDesignService + "/api/report/queryMdTree",
  2254. data: param,
  2255. callback: (code, message, response) => {
  2256. if (response.code === 0 || response.code === 200) {
  2257. if (response.data) {
  2258. this.treeData = response.data;
  2259. for (let item of this.treeData) {
  2260. this.defaultExportArr.push(item.id); // 导出数据准备 默认全选
  2261. item.label = item.name ? item.name : item.ename;
  2262. if (item.level == "A") {
  2263. item.icon = "el-icon-yx-images-project";
  2264. } else if (item.level == "B") {
  2265. item.icon = "el-icon-yx-images-floder";
  2266. } else {
  2267. expendLevelCData.push(item.id);
  2268. this.sumCount += 1; // 总的模型数量
  2269. if (item.lockFlag == "1") {
  2270. // 判断有无权限操作,控制多选
  2271. item.disabled = false;
  2272. } else {
  2273. item.disabled = false;
  2274. }
  2275. switch (item.modelState) {
  2276. case 0:
  2277. item.icon = "el-icon-yx-images-table-sptg";
  2278. break;
  2279. case 1:
  2280. item.icon = "el-icon-yx-images-table-shz";
  2281. // item.disabled = true;
  2282. break;
  2283. case 2:
  2284. item.icon = "el-icon-yx-images-table-cg";
  2285. break;
  2286. case 3:
  2287. item.icon = "el-icon-yx-images-table-jj";
  2288. break;
  2289. default:
  2290. break;
  2291. }
  2292. }
  2293. }
  2294. this.$nextTick(() => {
  2295. if (this.moduleId && this.moduleId !== "") {
  2296. this.$refs.menuTree.setCurrentKey(this.moduleId);
  2297. this.defaultArr = [this.moduleId];
  2298. }
  2299. });
  2300. if (this.filterText) {
  2301. // 搜索之后全部展开
  2302. this.defaultArr = [];
  2303. this.defaultArr = expendLevelCData;
  2304. }
  2305. }
  2306. } else {
  2307. this.$message({
  2308. type: "error",
  2309. message: response.message,
  2310. });
  2311. }
  2312. },
  2313. });
  2314. },
  2315. queryleftTree: function () {
  2316. let counts = 0;
  2317. this.sumCount = 0; // 先清空
  2318. this.checkBlue = false;
  2319. this.$refs.menuTree.setCheckedKeys([]);
  2320. this.checkedCount = 0;
  2321. if (!this.versionValue || !this.versionValue.versionCode) {
  2322. return;
  2323. }
  2324. yufp.service.request({
  2325. method: "get",
  2326. url: backend.modelDesignService + "/api/report/queryMdTree",
  2327. data: {
  2328. projectId: this.projectId,
  2329. version: this.versionValue.versionCode,
  2330. scope: this.scope,
  2331. withModel: true,
  2332. projectName: this.projectName,
  2333. },
  2334. callback: (code, message, response) => {
  2335. if (response.code === 0 || response.code === 200) {
  2336. if (response.data) {
  2337. this.treeData = response.data;
  2338. for (let item of this.treeData) {
  2339. this.defaultExportArr.push(item.id); // 导出数据准备 默认全选
  2340. item.label = item.name ? item.name : item.ename;
  2341. if (item.level == "A") {
  2342. item.icon = "el-icon-yx-images-project";
  2343. } else if (item.level == "B") {
  2344. item.icon = "el-icon-yx-images-floder";
  2345. // item.label = item.schema ? item.name + " " + '( ' + item.schema + ' )' : item.name
  2346. } else {
  2347. counts += 1; // 总的模型数量
  2348. if (item.lockFlag == "1") {
  2349. // 判断有无权限操作,控制多选
  2350. item.disabled = false;
  2351. } else {
  2352. item.disabled = false;
  2353. }
  2354. switch (item.modelState) {
  2355. case 0:
  2356. item.icon = "el-icon-yx-images-table-sptg";
  2357. break;
  2358. case 1:
  2359. item.icon = "el-icon-yx-images-table-shz";
  2360. // item.disabled = true;
  2361. break;
  2362. case 2:
  2363. item.icon = "el-icon-yx-images-table-cg";
  2364. break;
  2365. case 3:
  2366. item.icon = "el-icon-yx-images-table-jj";
  2367. break;
  2368. default:
  2369. break;
  2370. }
  2371. }
  2372. if (item.parentId == null) {
  2373. this.dataRoot = item; // 根节点
  2374. }
  2375. }
  2376. this.sumCount = counts;
  2377. if (this.treeData.length == 1 && !this.treeData[0].parentId) {
  2378. // 空项目情况处理
  2379. this.moduleId = null; // watch检测不到 ""
  2380. } else {
  2381. for (let item of this.treeData) {
  2382. if (item.level == "B") {
  2383. this.nodeClickFn(item);
  2384. // 默认第一条高亮
  2385. this.$nextTick(() => {
  2386. this.$refs.menuTree.setCurrentKey(item.id);
  2387. this.defaultArr = [item.id];
  2388. });
  2389. return;
  2390. }
  2391. }
  2392. }
  2393. }
  2394. } else {
  2395. this.$message({
  2396. type: "error",
  2397. message: response.message,
  2398. });
  2399. }
  2400. },
  2401. });
  2402. },
  2403. // 模型新增
  2404. addModelFn: function () {
  2405. this.$refs.mdCanvas.preCreateModel();
  2406. },
  2407. // 打开弹框,编辑模型
  2408. preEditModel: function (row) {
  2409. this.modelId = row.modelId;
  2410. this.editModelDialog = true;
  2411. this.openTime = Date.parse(new Date()) + "";
  2412. this.modelDisabled = row.flag;
  2413. // 双击外键连线进来-- 默认展示到
  2414. if (row.defaultTab && row.defaultTab == "fk") {
  2415. this.activeTab = "foreignKeyInfors";
  2416. } else {
  2417. this.activeTab = "basicInfors";
  2418. }
  2419. },
  2420. // 回调触发点击目录
  2421. backRefeshTree(row) {
  2422. let nodeData = {
  2423. id: row.moduleId,
  2424. level: "B",
  2425. };
  2426. this.nodeClickFn(nodeData);
  2427. },
  2428. // 模型上传
  2429. upModelFn: function () {
  2430. // 当模式是逻辑模型时,点击导出按钮时,直接导出excel
  2431. if (this.showButFlag == true) {
  2432. this.uploadDialog = false;
  2433. } else {
  2434. this.uploadDialog = true;
  2435. this.$nextTick(() => {
  2436. this.$refs.fileTypeFormRef.resetFields();
  2437. this.$refs.fileTypeFormRef.formdata.fileType = "EXCEL";
  2438. });
  2439. }
  2440. },
  2441. // 模型导入
  2442. downModelFn: function () {
  2443. this.dialogImport = true;
  2444. this.$nextTick(() => {
  2445. this.activeNum = 1;
  2446. this.msgg = this.$t("module.7e716b44-13f2-4ede-8953-1f44bab4e774");
  2447. this.errorMessage = "";
  2448. this.openTimes = Date.parse(new Date()) + "";
  2449. this.otherData = {
  2450. projectId: this.projectId,
  2451. modelVersion: this.versionValue.versionCode,
  2452. ifStd: this.ifStd,
  2453. };
  2454. });
  2455. },
  2456. submitOne: function () {
  2457. let selectArr = this.$refs.menuTree.getCheckedNodes();
  2458. let realArr = [],
  2459. finalRealArr = [],
  2460. realIdArr = [];
  2461. // 剔除根节点数据 -- 并且排除待审批状态数据
  2462. realArr = this.filteModelFn(selectArr);
  2463. if (realArr.length == 0) {
  2464. this.$message({
  2465. type: "warning",
  2466. message: this.$t("module.cfcb2243-aebd-45ad-8ad7-1ca47b09137f"),
  2467. });
  2468. return;
  2469. }
  2470. for (let item of realArr) {
  2471. if (item.modelState !== 1) {
  2472. finalRealArr.push(item);
  2473. }
  2474. }
  2475. if (finalRealArr.length == 0) {
  2476. this.$message({
  2477. type: "warning",
  2478. message: this.$t("module.bdc42479-b338-49e5-aca0-a7cb398f63dc"),
  2479. });
  2480. return;
  2481. }
  2482. for (let item of finalRealArr) {
  2483. realIdArr.push(item.id);
  2484. }
  2485. this.realIds = realIdArr.join(",");
  2486. this.modelSubDialog = true;
  2487. this.openTimeSub = Date.parse(new Date()) + "";
  2488. },
  2489. exportFn: function () {
  2490. this.$confirm(
  2491. this.$t("module.a1d72772-80bf-4500-9c67-825ad4265899"),
  2492. this.$t("base.a0c6494a-5423-4be2-8292-6f75fd4e5e71"),
  2493. {
  2494. type: "warning",
  2495. callback: (action) => {
  2496. if (action === "confirm") {
  2497. let selectArr = this.$refs.modelExportTree.getCheckedNodes();
  2498. let realArr = [],
  2499. realIdArr = [],
  2500. realId = "";
  2501. // 剔除根节点数据
  2502. realArr = this.filteModelFn(selectArr);
  2503. if (realArr.length == 0) {
  2504. this.$message({
  2505. type: "warning",
  2506. message: this.$t(
  2507. "module.14ba93f6-0b60-4fe4-82fd-0313f0ac3ae1"
  2508. ),
  2509. });
  2510. return;
  2511. }
  2512. for (let item of realArr) {
  2513. realIdArr.push(item.id);
  2514. }
  2515. realId = realIdArr.join(",");
  2516. let url = "";
  2517. if (this.exportFlag == "excel") {
  2518. url = yufp.service.getUrl({
  2519. url: "/api/excel/export",
  2520. });
  2521. } else if (this.exportFlag == "ddl") {
  2522. url = yufp.service.getUrl({
  2523. url: "/api/ddl/exportByModel",
  2524. });
  2525. }
  2526. const formdata = new FormData();
  2527. formdata.append("modelId", realId);
  2528. formdata.append("projectId", this.projectId);
  2529. formdata.append("versionCode", "master");
  2530. let objData = {};
  2531. for (var entry of formdata.entries()) {
  2532. objData[entry[0]] = entry[1];
  2533. }
  2534. let jsonForm = JSON.stringify(objData);
  2535. let request = new XMLHttpRequest();
  2536. request.open("POST", backend.modelDesignService + url, true);
  2537. request.responseType = "blob"; // 注意 mockjs会把responseType置为空; 必须注掉
  2538. request.setRequestHeader("TOKEN", yufp.service.getToken());
  2539. request.setRequestHeader("Content-Type", "application/json");
  2540. request.onload = function (e) {
  2541. if (this.status == 200) {
  2542. var name = request.getResponseHeader("Content-Disposition");
  2543. var fileName = name.substring(20, name.length);
  2544. // // 返回的文件流,转换成blob对象
  2545. var blob = new Blob([request.response], {
  2546. type: "application/vnd.ms-excel",
  2547. });
  2548. // 转换成blob类型的url
  2549. var blobUrl = URL.createObjectURL(blob);
  2550. // 模拟 a 标签进行下载
  2551. var eLink = document.createElement("a");
  2552. // 设置 a 标签的展示方式,默认 display:none
  2553. eLink.style.display = "none";
  2554. // 设置 a 标签的 url
  2555. eLink.href = blobUrl;
  2556. // 设置 下载文件的文件名称
  2557. eLink.download = fileName;
  2558. // eLink.download = 'data'
  2559. document.body.appendChild(eLink);
  2560. eLink.click();
  2561. document.body.removeChild(eLink);
  2562. }
  2563. };
  2564. request.send(jsonForm);
  2565. }
  2566. },
  2567. }
  2568. );
  2569. },
  2570. // 计算 选中的数据只包含model
  2571. filteModelFn: function (selectArr) {
  2572. let realArr = [];
  2573. // 剔除根节点数据
  2574. for (let item of selectArr) {
  2575. if (item.level == "C") {
  2576. realArr.push(item);
  2577. }
  2578. }
  2579. return realArr;
  2580. },
  2581. // 逻辑模型转物理模型
  2582. transModelFn: function () {
  2583. this.dbTypeDialog = true;
  2584. this.$nextTick(() => {
  2585. this.$refs.formRef.resetFields();
  2586. });
  2587. },
  2588. // 逻辑模型转物理模型取消
  2589. cancelFn: function () {
  2590. this.dbTypeDialog = false;
  2591. },
  2592. // 逻辑模型转物理模型确定
  2593. commitFn: function () {
  2594. this.dbTypeDialog = false;
  2595. },
  2596. // 确定导出
  2597. uploadFn: function () {
  2598. this.uploadDialog = false;
  2599. },
  2600. // 版本数据
  2601. exportIncreFn: function (flag) {
  2602. yufp.service.request({
  2603. method: "GET",
  2604. url:
  2605. backend.modelDesignService +
  2606. "/api/mdprojectversion/queryProjectVersion",
  2607. data: {
  2608. projectId: this.projectId,
  2609. page: "1",
  2610. size: "100000",
  2611. },
  2612. callback: (code, message, response) => {
  2613. if (response.code === 200) {
  2614. let option1 = [],
  2615. option2 = [],
  2616. versionArr = response.data || [],
  2617. versionValue;
  2618. if (this.data.versionValue && flag == "auto") {
  2619. // 画布 列表切换时 优先取传递来的数据展示
  2620. versionValue = this.data.versionValue;
  2621. } else if (this.data.taskId && flag == "auto") {
  2622. // 从数据中台 任务开发 进入
  2623. this.taskId = this.data.taskId; // 任务id
  2624. versionValue = versionArr.find((item) => {
  2625. return item.jobId == this.taskId;
  2626. });
  2627. }
  2628. if (!versionValue) {
  2629. versionValue = versionArr.find(
  2630. (item) => item.versionCode == "master"
  2631. );
  2632. }
  2633. this.versionValue = versionValue;
  2634. this.queryleftTree();
  2635. // 版本分组
  2636. versionArr.forEach((element) => {
  2637. if (!element.versionType || element.versionType == "Branch") {
  2638. option1.push(element);
  2639. }
  2640. if (element.versionType == "Tag") {
  2641. option2.push(element);
  2642. }
  2643. });
  2644. let arr = [
  2645. {
  2646. label: "Branch",
  2647. options: option1,
  2648. },
  2649. {
  2650. label: "Tag",
  2651. options: option2,
  2652. },
  2653. ];
  2654. this.versionData = arr;
  2655. } else {
  2656. this.$message({
  2657. type: "error",
  2658. message: response.message,
  2659. });
  2660. }
  2661. },
  2662. });
  2663. },
  2664. // 指定数据库类型
  2665. // confirmDbType() {
  2666. // let validate = false;
  2667. // this.$refs.dbTypeFormRef.validate((valid) => {
  2668. // validate = valid;
  2669. // });
  2670. // if (!validate) {
  2671. // return;
  2672. // }
  2673. // let param = {
  2674. // id: this.projectId,
  2675. // projectDbType: this.dbTypeForm.projectDbType,
  2676. // projectName: this.projectName
  2677. // }
  2678. // yufp.service.request({
  2679. // method: 'post',
  2680. // url: backend.modelDesignService + '/api/mdproject/addProject',
  2681. // data: param,
  2682. // callback: (code, message, response) => {
  2683. // if (response.code === 0 || response.code === 200) {
  2684. // yufp.router.to('frame');
  2685. // } else {
  2686. // this.$message({
  2687. // type: 'error',
  2688. // message: response.message
  2689. // });
  2690. // }
  2691. // }
  2692. // });
  2693. // },
  2694. modelShow(sf) {
  2695. var ws = yufp.util.dms.getWorkbenchState();
  2696. ws.viewMode = sf;
  2697. yufp.util.dms.saveWorkbenchState(ws);
  2698. this.modelShowFlag = sf;
  2699. this.$refs.mdCanvas.initLocal("sf");
  2700. },
  2701. showCnoren() {
  2702. var ws = yufp.util.dms.getWorkbenchState();
  2703. var scr = null;
  2704. if (ws.showCnoren == "cn") {
  2705. scr = "en";
  2706. }
  2707. if (ws.showCnoren == "en") {
  2708. scr = "cn";
  2709. }
  2710. ws.showCnoren = scr;
  2711. yufp.util.dms.saveWorkbenchState(ws);
  2712. this.$refs.mdCanvas.initLocal("en2cn");
  2713. },
  2714. //自动布局
  2715. autoLayout() {
  2716. this.$confirm(
  2717. this.$t("module.be5593e6-0c87-4a1a-a46c-ccfe2dbbe169"),
  2718. this.$t("module.a4d141fa-8dbd-48b5-bb1b-6e980fd7e477"),
  2719. {
  2720. confirmButtonText: this.$t(
  2721. "module.e1f5797b-071e-41a2-9ca4-421b32458c6e"
  2722. ),
  2723. cancelButtonText: this.$t(
  2724. "module.de26e309-74a6-48ce-8fa4-c37cb63cf622"
  2725. ),
  2726. type: "warning",
  2727. callback: (action) => {
  2728. if (action === "confirm") {
  2729. this.autoLayoutCfgFlag = true;
  2730. this.$nextTick(() => {
  2731. this.autoLayoutCfg.n = 4;
  2732. this.autoLayoutCfg.rowHeight = 200;
  2733. });
  2734. }
  2735. },
  2736. }
  2737. );
  2738. },
  2739. doLayout() {
  2740. yufp.service.request({
  2741. method: "get",
  2742. url: backend.modelDesignService + "/api/mdmodel/autoLayout",
  2743. data: {
  2744. moduleId: this.moduleId,
  2745. version: this.versionValue.versionCode,
  2746. n: this.autoLayoutCfg.n,
  2747. rowHeight: this.autoLayoutCfg.rowHeight,
  2748. scope: this.scope,
  2749. },
  2750. callback: () => {
  2751. this.autoLayoutCfgFlag = false;
  2752. this.$refs.mdCanvas.init();
  2753. },
  2754. });
  2755. },
  2756. domChange1() {
  2757. // 实时检测模型比编辑框的高度
  2758. let MutationObserver =
  2759. window.MutationObserver ||
  2760. window.WebKitMutationObserver ||
  2761. window.MozMutationObserver;
  2762. let element = document.querySelector(".modelDialog .el-dialog-x");
  2763. this.observer1 = new MutationObserver((mutationList) => {
  2764. let width = window.getComputedStyle(element).getPropertyValue("width");
  2765. let height = window
  2766. .getComputedStyle(element)
  2767. .getPropertyValue("height");
  2768. if (
  2769. width === this.recordOldValue1.width &&
  2770. height === this.recordOldValue1.height
  2771. ) {
  2772. return;
  2773. }
  2774. this.recordOldValue1 = {
  2775. width,
  2776. height,
  2777. };
  2778. this.diaHeight =
  2779. this.recordOldValue1.height.substring(
  2780. 0,
  2781. this.recordOldValue1.height.length - 2
  2782. ) *
  2783. 1 -
  2784. 155;
  2785. });
  2786. element &&
  2787. this.observer1.observe(element, {
  2788. attributes: true,
  2789. attributeFilter: ["style"],
  2790. attributeOldValue: true,
  2791. });
  2792. yufp.util.dms.globalVm.$on("dialog-size", (target, infors) => {
  2793. let element = document.querySelector(".modelDialog .el-dialog-x");
  2794. let height = window
  2795. .getComputedStyle(element)
  2796. .getPropertyValue("height");
  2797. this.diaHeight = height.substring(0, height.length - 2) * 1 - 155;
  2798. });
  2799. },
  2800. },
  2801. created() {
  2802. yufp.util.globalVm.$on("changeProjectVal", (proObj) => {
  2803. //刷新页面数据
  2804. // this.queryProjectData(proObj);
  2805. this.domChange1();
  2806. });
  2807. },
  2808. mounted: function () {
  2809. // 初始进来默认加载左侧树
  2810. $(".dms-bodys").addClass("nav_is_visible");
  2811. this.domChange1();
  2812. // 初始化查询检查项
  2813. this.queryCheckRules().then((datas) => {
  2814. this.rules = datas;
  2815. if (datas && datas.length) {
  2816. this.isIndeterminate = true;
  2817. this.checkedRules = this.rules.map((item) => {
  2818. return item.id;
  2819. });
  2820. }
  2821. });
  2822. },
  2823. beforeDestroyed() {
  2824. if (this.observer1) {
  2825. this.observer1.disconnect();
  2826. this.observer1.takeRecords();
  2827. this.observer1 = null;
  2828. }
  2829. },
  2830. };
  2831. </script>
  2832. <style scoped lang="scss">
  2833. .dev-config {
  2834. height: 100%;
  2835. .dms-bodys {
  2836. height: calc(100% - 41px);
  2837. .home_is_visible {
  2838. height: 100%;
  2839. .dms-content {
  2840. height: 100%;
  2841. #modelTTree {
  2842. height: 100%;
  2843. }
  2844. }
  2845. }
  2846. }
  2847. }
  2848. .sql_collapse .el-collapse-item__header {
  2849. background-color: #dfe6ec;
  2850. /* border-bottom: 0px solid #dfe6ec !important; */
  2851. }
  2852. /* .sql_collapse .el-collapse-item__wrap {
  2853. border-bottom: 0px solid #dfe6ec !important;
  2854. } */
  2855. /* .sql_collapse .el-collapse-item__header {
  2856. border-bottom: 0px solid #dfe6ec !important;
  2857. } */
  2858. .sql_collapse .el-collapse-item__content {
  2859. padding: 0 !important;
  2860. }
  2861. .monaco-editor {
  2862. /* height: 100px !important; */
  2863. }
  2864. /* .step-content {} */
  2865. .normal-dialog .el-dialog-x {
  2866. top: 30vh !important;
  2867. }
  2868. .left-select {
  2869. padding: 5px 0 0 0;
  2870. }
  2871. .left-select .el-input--small .el-input__inner {
  2872. height: 26px;
  2873. }
  2874. .liStyle {
  2875. margin-left: 25px;
  2876. }
  2877. .myLi {
  2878. position: relative;
  2879. }
  2880. .el-icon-yx-images-more {
  2881. background: url(~assets/dms/img/more.png) no-repeat center;
  2882. width: 18px;
  2883. height: 18px;
  2884. background-size: 18px 18px;
  2885. }
  2886. .el-icon-yx-images-modify {
  2887. background: url(~assets/dms/img/modify.png) no-repeat center;
  2888. width: 16px;
  2889. height: 16px;
  2890. background-size: 16px 16px;
  2891. /* position: absolute;
  2892. top: 9px; */
  2893. }
  2894. .el-icon-yx-images-delete {
  2895. background: url(~assets/dms/img/delete.png) no-repeat center;
  2896. width: 16px;
  2897. height: 16px;
  2898. background-size: 16px 16px;
  2899. /* position: absolute;
  2900. top: 9px; */
  2901. }
  2902. #menuConfigs .iconpwd:before {
  2903. color: #999999;
  2904. /* content: "/e66c"; */
  2905. opacity: 0.8;
  2906. position: relative;
  2907. }
  2908. .label-model {
  2909. float: left;
  2910. font-size: 13px;
  2911. }
  2912. .lock-model {
  2913. float: right;
  2914. }
  2915. .search-model {
  2916. margin: 10px 8px 0px 8px;
  2917. }
  2918. .account-model {
  2919. position: relative;
  2920. margin: 8px;
  2921. font-size: 18px;
  2922. }
  2923. .account-model .iconmoxing:before {
  2924. font-size: 14px;
  2925. }
  2926. .account-model .el-checkbox__input {
  2927. width: 14px;
  2928. height: 14px;
  2929. margin-top: -4px;
  2930. }
  2931. .account-model .el-checkbox__label {
  2932. font-size: 12px;
  2933. }
  2934. .account-model .el-checkbox {
  2935. margin-right: 0px;
  2936. }
  2937. .treeStyle {
  2938. border-right: 1px solid #d1dbe5;
  2939. }
  2940. .count_label {
  2941. margin-right: 5px;
  2942. cursor: pointer;
  2943. }
  2944. .count_label:hover {
  2945. color: var(--main-color);
  2946. }
  2947. .count_labels {
  2948. top: 2px;
  2949. right: 2px;
  2950. position: absolute;
  2951. color: #909399;
  2952. font-size: 14px;
  2953. font-weight: 400;
  2954. }
  2955. .count_label-sub span {
  2956. right: 34px;
  2957. position: absolute;
  2958. color: #909399;
  2959. font-size: 16px;
  2960. font-weight: 400;
  2961. }
  2962. .projectDisplay {
  2963. background: #fff;
  2964. border-bottom: 1px solid #d1dbe5;
  2965. padding: 0 10px;
  2966. }
  2967. .treeStyle .el-tree-x {
  2968. border: 0px solid #d1dbe5;
  2969. /* background: #F7F8FA; */
  2970. }
  2971. .treeStyle .el-tree-node__label,
  2972. .el-tree-node__loading-icon {
  2973. font-size: 12px !important;
  2974. }
  2975. .treeStyle .el-input__inner {
  2976. font-size: 12px !important;
  2977. height: 32px !important;
  2978. }
  2979. .treeStyle .el-tree-node__content {
  2980. height: 34px;
  2981. }
  2982. .el-icon-yx-images-modelTree {
  2983. background: url(~assets/dms/img/modelTree.svg) no-repeat center;
  2984. width: 14px;
  2985. height: 14px;
  2986. background-size: 14px 14px;
  2987. /* background-size: 18px 18px; */
  2988. }
  2989. .leftButton {
  2990. padding: 6px 0px 0px 0px;
  2991. }
  2992. .buttonSty {
  2993. text-align: right;
  2994. word-spacing: -1em;
  2995. }
  2996. .buttonSty > div {
  2997. display: inline-block;
  2998. padding: 2px 10px;
  2999. /* color: #fff; */
  3000. letter-spacing: 0.67px;
  3001. font-size: 16px;
  3002. line-height: 28px;
  3003. }
  3004. .buttonSty > div :hover {
  3005. color: var(--main-color);
  3006. cursor: pointer;
  3007. }
  3008. .pro_model_tree {
  3009. overflow: auto !important;
  3010. }
  3011. .minWindowR {
  3012. // width: 30px;
  3013. width: 70px;
  3014. background: rgb(244, 245, 245);
  3015. text-align: center;
  3016. position: absolute;
  3017. right: 0;
  3018. bottom: 0;
  3019. top: 45px;
  3020. }
  3021. .active,
  3022. .right_icon:active,
  3023. .right_icon:hover {
  3024. background: #fff;
  3025. }
  3026. .right_icon.div_disabled:active,
  3027. .right_icon.div_disabled:hover {
  3028. background: #f4f5f5;
  3029. color: #999;
  3030. }
  3031. .right_icon.div_disabled:hover .icon_active {
  3032. color: #999;
  3033. }
  3034. .active .icon_active,
  3035. .right_icon:hover .icon_active {
  3036. color: #255ddb;
  3037. }
  3038. .right_view {
  3039. border-left: 1px slid #666;
  3040. // padding: 0 10px 10px;
  3041. min-width: 200px;
  3042. }
  3043. .right_view .header {
  3044. // position: absolute;
  3045. // left: 92px;
  3046. // top: 20px;
  3047. width: 100%;
  3048. display: flex;
  3049. align-items: center;
  3050. justify-content: flex-end;
  3051. }
  3052. .right_view .header span {
  3053. display: block;
  3054. width: fit-content;
  3055. padding-left: 3px;
  3056. padding-right: 3px;
  3057. // width: 68px;
  3058. line-height: 24px;
  3059. text-align: center;
  3060. height: 24px;
  3061. border-radius: 2px;
  3062. border-color: rgb(240 44 93 / 21%);
  3063. border: 1px solid #255ddb;
  3064. }
  3065. .tree_input_icon .el-input__suffix,
  3066. .right_view .el-input__suffix {
  3067. right: 15px;
  3068. }
  3069. .drawer_tabs .el-drawer__header {
  3070. margin-bottom: 0px;
  3071. padding: 10px 12px 0;
  3072. }
  3073. .drawer_tabs .el-drawer__body {
  3074. padding: 0 0 0 10px;
  3075. }
  3076. .rules_all {
  3077. height: 420px;
  3078. overflow-y: auto;
  3079. }
  3080. .rules_all .el-checkbox.el-checkbox {
  3081. display: block;
  3082. }
  3083. .right_view ::v-deep .el-tabs__nav-wrap.is-top .el-tabs__nav-scroll {
  3084. margin: 0;
  3085. }
  3086. .right_view ::v-deep .el-tree-node__label,
  3087. .el-tree-node__loading-icon {
  3088. font-size: 12px;
  3089. }
  3090. .leftChange {
  3091. left: 127px !important;
  3092. }
  3093. </style>